diff --git a/package-lock.json b/package-lock.json index 7ebfbe2..2c4ed13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8480,7 +8480,7 @@ }, "packages/client": { "name": "@code-wallet/client", - "version": "2.0.8", + "version": "2.0.9", "license": "MIT", "dependencies": { "@code-wallet/intents": "^1.0.0", @@ -8519,7 +8519,7 @@ }, "packages/elements": { "name": "@code-wallet/elements", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "dependencies": { "@code-wallet/client": "^2.0.6", @@ -8577,12 +8577,12 @@ }, "packages/intents": { "name": "@code-wallet/intents", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "dependencies": { "@code-wallet/currency": "^1.0.0", "@code-wallet/keys": "^1.0.0", - "@code-wallet/kikcode": "^1.0.0", + "@code-wallet/kikcode": "^1.0.5", "@code-wallet/rpc": "^1.3.1", "@noble/hashes": "^1.3.0", "bs58": "^5.0.0", @@ -8622,12 +8622,13 @@ }, "packages/kikcode": { "name": "@code-wallet/kikcode", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "dependencies": { "@code-wallet/currency": "^1.0.0" }, "devDependencies": { + "@noble/hashes": "^1.3.2", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", @@ -8872,7 +8873,7 @@ }, "packages/views": { "name": "@code-wallet/views", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "dependencies": { "@code-wallet/events": "^1.4.0", @@ -9657,7 +9658,7 @@ "requires": { "@code-wallet/currency": "^1.0.0", "@code-wallet/keys": "^1.0.0", - "@code-wallet/kikcode": "^1.0.0", + "@code-wallet/kikcode": "^1.0.5", "@code-wallet/rpc": "^1.3.1", "@noble/hashes": "^1.3.0", "@types/chai": "^4.3.5", @@ -9693,6 +9694,7 @@ "version": "file:packages/kikcode", "requires": { "@code-wallet/currency": "^1.0.0", + "@noble/hashes": "^1.3.2", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", diff --git a/packages/client/package.json b/packages/client/package.json index df0c3ea..815656a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/client", - "version": "2.0.8", + "version": "2.0.9", "license": "MIT", "repository": { "type": "git", diff --git a/packages/client/src/utils/createIntent.ts b/packages/client/src/utils/createIntent.ts index 379f6b6..32bdffa 100644 --- a/packages/client/src/utils/createIntent.ts +++ b/packages/client/src/utils/createIntent.ts @@ -1,14 +1,17 @@ -import { Client } from "../client"; -import { Intent, } from "@code-wallet/intents"; import * as proto from "@code-wallet/rpc"; +import { Intent, IntentWithMessage } from "@code-wallet/intents"; +import { Client } from "../client"; import { ErrUnexpectedError } from "../errors"; async function createIntent(intent: Intent, client: Client) { - const msg = await intent.getSendMessageRequestProto() - const res = await client.send(proto.Messaging, 'sendMessage', msg); + if (intent.hasMessage()) { + const withMessage = intent as IntentWithMessage; + const msg = await withMessage.getSendMessageRequestProto(); + const res = await client.send(proto.Messaging, 'sendMessage', msg); - if (res.result !== proto.SendMessageResponse_Result.OK) { - ErrUnexpectedError(); + if (res.result !== proto.SendMessageResponse_Result.OK) { + ErrUnexpectedError(); + } } return { diff --git a/packages/elements/example/index.html b/packages/elements/example/index.html index a52b3ab..f54e7a6 100644 --- a/packages/elements/example/index.html +++ b/packages/elements/example/index.html @@ -12,13 +12,17 @@
+
+
+ + diff --git a/packages/elements/package.json b/packages/elements/package.json index e2cabae..8e0c2bc 100644 --- a/packages/elements/package.json +++ b/packages/elements/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/elements", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "repository": { "type": "git", diff --git a/packages/elements/src/components/elements/IntentRequestModalDesktop.vue b/packages/elements/src/components/elements/IntentRequestModalDesktop.vue index da682b1..e790cf1 100644 --- a/packages/elements/src/components/elements/IntentRequestModalDesktop.vue +++ b/packages/elements/src/components/elements/IntentRequestModalDesktop.vue @@ -6,7 +6,10 @@ const config = useConfig(); const options = inject('options'); - const mode = options?.mode ?? 'payment'; + + const props = defineProps<{ + asPage?: boolean, + }>(); const emit = defineEmits([ 'codeScanned', @@ -20,7 +23,9 @@ ]); const channel = new EventChannel(); - const url = `${config.codeSdk()}/${mode}-request-modal-desktop/#/${channel.id}/p=${encode(options)}`; + const mode = options?.mode ?? 'payment'; + const kind = props.asPage ? 'page' : 'modal'; + const url = `${config.codeSdk()}/${mode}-request-${kind}-desktop/#/${channel.id}/p=${encode(options)}`; const el = ref(null); console.log('url', url); @@ -79,9 +84,10 @@ function getStyle() : { [key:string]: string } { const _ = (v:string) => v + ' !important'; + const inset = { inset: _('0'), top: _('0'), left: _('0'), right: _('0'), bottom: _('0'), } return { + ...inset, position: _('fixed'), - inset: _('0'), zIndex: _('2147483647'), overflow: _('hidden'), width: _('100dvw'), diff --git a/packages/elements/src/components/elements/IntentRequestModalMobile.vue b/packages/elements/src/components/elements/IntentRequestModalMobile.vue index c4318a8..1f80dc2 100644 --- a/packages/elements/src/components/elements/IntentRequestModalMobile.vue +++ b/packages/elements/src/components/elements/IntentRequestModalMobile.vue @@ -8,6 +8,10 @@ const options = inject('options'); const mode = options?.mode ?? 'payment'; + const props = defineProps<{ + asPage?: boolean, + }>(); + const emit = defineEmits([ 'codeScanned', 'clientRejectedPayment', @@ -20,7 +24,8 @@ ]); const channel = new EventChannel(); - const url = `${config.codeSdk()}/${mode}-request-modal-mobile/#/${channel.id}/p=${encode(options)}`; + const kind = props.asPage ? 'page' : 'modal'; + const url = `${config.codeSdk()}/${mode}-request-${kind}-mobile/#/${channel.id}/p=${encode(options)}`; const el = ref(null); channel.on('codeScanned' , () => { emit('codeScanned'); }); @@ -82,9 +87,10 @@ function getStyle() : { [key:string]: string } { const _ = (v:string) => v + ' !important'; + const inset = { inset: _('0'), top: _('0'), left: _('0'), right: _('0'), bottom: _('0'), } return { + ...inset, position: _('fixed'), - inset: _('0'), zIndex: _('2147483647'), overflow: _('hidden'), width: _('100dvw'), diff --git a/packages/elements/src/components/flows/ButtonFlow.vue b/packages/elements/src/components/flows/ButtonFlow.vue index eaa8547..7225da9 100644 --- a/packages/elements/src/components/flows/ButtonFlow.vue +++ b/packages/elements/src/components/flows/ButtonFlow.vue @@ -1,12 +1,14 @@ + + diff --git a/packages/elements/src/components/flows/index.ts b/packages/elements/src/components/flows/index.ts deleted file mode 100644 index 6e91e08..0000000 --- a/packages/elements/src/components/flows/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as ButtonFlow } from './ButtonFlow.vue' \ No newline at end of file diff --git a/packages/elements/src/components/index.ts b/packages/elements/src/components/index.ts index 52f06bd..1a666de 100644 --- a/packages/elements/src/components/index.ts +++ b/packages/elements/src/components/index.ts @@ -1,2 +1,4 @@ export * from './elements'; -export * from './flows'; \ No newline at end of file + +export { default as ButtonFlow } from './flows/ButtonFlow.vue'; +export { default as PageFlow } from './flows/PageFlow.vue'; \ No newline at end of file diff --git a/packages/elements/src/components/preload/PreloadIntentRequestModalDesktop.vue b/packages/elements/src/components/preload/PreloadIntentRequestModalDesktop.vue index b3d08be..f128a36 100644 --- a/packages/elements/src/components/preload/PreloadIntentRequestModalDesktop.vue +++ b/packages/elements/src/components/preload/PreloadIntentRequestModalDesktop.vue @@ -3,10 +3,15 @@ import { useConfig } from '../../config'; import { inject, ref } from 'vue'; + const props = defineProps<{ + asPage?: boolean, + }>(); + const config = useConfig(); const options = inject('options'); const mode = options?.mode ?? 'payment'; - const url = `${config.codeSdk()}/${mode}-request-modal-desktop/#/preload/p=${encode(options)}`; + const kind = props.asPage ? 'page' : 'modal'; + const url = `${config.codeSdk()}/${mode}-request-${kind}-desktop/#/preload/p=${encode(options)}`; const el = ref(null); function getStyle() : { [key:string]: string } { diff --git a/packages/elements/src/components/preload/PreloadIntentRequestModalMobile.vue b/packages/elements/src/components/preload/PreloadIntentRequestModalMobile.vue index 5757005..09b1897 100644 --- a/packages/elements/src/components/preload/PreloadIntentRequestModalMobile.vue +++ b/packages/elements/src/components/preload/PreloadIntentRequestModalMobile.vue @@ -3,10 +3,15 @@ import { useConfig } from '../../config'; import { inject, ref } from 'vue'; + const props = defineProps<{ + asPage?: boolean, + }>(); + const config = useConfig(); const options = inject('options'); const mode = options?.mode ?? 'payment'; - const url = `${config.codeSdk()}/${mode}-request-modal-mobile/#/preload/p=${encode(options)}`; + const kind = props.asPage ? 'page' : 'modal'; + const url = `${config.codeSdk()}/${mode}-request-${kind}-mobile/#/preload/p=${encode(options)}`; const el = ref(null); function getStyle() : { [key:string]: string } { diff --git a/packages/elements/src/elements.ts b/packages/elements/src/elements.ts index 9b5ff75..d9f7af5 100644 --- a/packages/elements/src/elements.ts +++ b/packages/elements/src/elements.ts @@ -1,5 +1,4 @@ import { App as VueApp, createApp, reactive } from 'vue'; - import { ElementEventEmitter, ElementEvents, @@ -9,10 +8,11 @@ import { validateElementOptions } from '@code-wallet/intents'; +import { withoutReactivity } from './utils/state'; import { ErrUnknownElementType } from './errors'; import { ButtonFlow, - IntentRequestModalDesktop, + PageFlow, } from './components'; const defaultMode = 'payment'; @@ -35,7 +35,7 @@ export interface CodeElement { /** * Abstract class representing a general element with common functionalities. */ -abstract class AbstractElement implements CodeElement { +abstract class BaseElement implements CodeElement { listeners: { event: string, callback: (args: any) => Promise }[]; intent: ElementOptions; app: VueApp; @@ -152,20 +152,10 @@ abstract class AbstractElement implements CodeElement { } } -/** - * Utility function to create a deep clone of the object without Vue's reactivity system. - * @param obj - The object to process. - * @returns A deep clone of the object without reactivity. - */ -function withoutReactivity(obj?: unknown) { - if (typeof obj !== 'object') { return obj; } - return JSON.parse(JSON.stringify(obj)); -} - /** * Concrete class representing a specialized button element. */ -class CodeButton extends AbstractElement { +class CodeButton extends BaseElement { /** * Constructs a new CodeButton with specific options. * @param options - Partial element options. @@ -176,15 +166,15 @@ class CodeButton extends AbstractElement { } /** - * Concrete class representing a specialized card element. + * Concrete class representing a specialized page element. */ -class CodeCard extends AbstractElement { +class CodePage extends BaseElement { /** - * Constructs a new CodeCard with specific options. + * Constructs a new CodePage with specific options. * @param options - Partial element options. */ constructor(options: Partial) { - super(options, createApp(IntentRequestModalDesktop)); + super(options, createApp(PageFlow)); } } @@ -198,12 +188,17 @@ const elements = { * @param options - The options for the element. * @returns An object containing the newly created element. */ - create: (type: ElementType, options: Omit): { button?: CodeElement, card?: CodeElement } => { + create: (type: ElementType, options: Omit): { + button?: CodeElement, + page?: CodeElement, + } => { switch (type) { case 'button': return { button: new CodeButton(options) }; + case 'page': + return { page: new CodePage(options) }; case 'card': - return { card: new CodeCard(options) }; + throw new Error('Card elements are not yet supported.'); default: throw ErrUnknownElementType(type); } diff --git a/packages/elements/src/utils/delay.ts b/packages/elements/src/utils/delay.ts new file mode 100644 index 0000000..dc27eb4 --- /dev/null +++ b/packages/elements/src/utils/delay.ts @@ -0,0 +1,5 @@ +const sleep = (ms:number) => new Promise(resolve => setTimeout(resolve, ms)); + +export { + sleep +} \ No newline at end of file diff --git a/packages/elements/src/utils/state.ts b/packages/elements/src/utils/state.ts new file mode 100644 index 0000000..2c1d192 --- /dev/null +++ b/packages/elements/src/utils/state.ts @@ -0,0 +1,11 @@ +/** + * Utility function to create a deep clone of the object without Vue's reactivity system. + * @param obj - The object to process. + * @returns A deep clone of the object without reactivity. + */ +function withoutReactivity(obj?: unknown) { + if (typeof obj !== 'object') { return obj; } + return JSON.parse(JSON.stringify(obj)); +} + +export { withoutReactivity }; \ No newline at end of file diff --git a/packages/intents/package.json b/packages/intents/package.json index 21e531e..d05c5a8 100644 --- a/packages/intents/package.json +++ b/packages/intents/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/intents", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "repository": { "type": "git", @@ -26,7 +26,7 @@ "@code-wallet/rpc": "^1.3.1", "@code-wallet/keys": "^1.0.0", "@code-wallet/currency": "^1.0.0", - "@code-wallet/kikcode": "^1.0.0", + "@code-wallet/kikcode": "^1.0.5", "@noble/hashes": "^1.3.0", "bs58": "^5.0.0", "buffer": "6.0.3" diff --git a/packages/intents/src/errors.ts b/packages/intents/src/errors.ts index 49c77ae..f4a4afe 100644 --- a/packages/intents/src/errors.ts +++ b/packages/intents/src/errors.ts @@ -18,6 +18,9 @@ const ErrLoginIPNotSupported = () => new Error("login IP addresses are not suppo const ErrLoginLocalhostNotSupported = () => new Error("login localhost is not supported"); const ErrLoginPortsNotSupported = () => new Error("login ports are not supported"); const ErrLoginExpectedDomainName = () => new Error("login expected domain name but received a path"); +const ErrPlatformRequired = () => new Error("platform is required"); +const ErrExpectedPlatformName = () => new Error("expected platform name"); +const ErrExpectedUsername = () => new Error("expected username"); export { ErrNotImplemented, @@ -40,4 +43,7 @@ export { ErrLoginLocalhostNotSupported, ErrLoginPortsNotSupported, ErrLoginExpectedDomainName, + ErrPlatformRequired, + ErrExpectedPlatformName, + ErrExpectedUsername, }; diff --git a/packages/intents/src/intents/AbstractIntent.ts b/packages/intents/src/intents/BaseIntent.ts similarity index 71% rename from packages/intents/src/intents/AbstractIntent.ts rename to packages/intents/src/intents/BaseIntent.ts index 2794094..7c03414 100644 --- a/packages/intents/src/intents/AbstractIntent.ts +++ b/packages/intents/src/intents/BaseIntent.ts @@ -3,14 +3,14 @@ import { Keypair } from '@code-wallet/keys'; import { CodePayload } from '@code-wallet/kikcode'; import { ElementOptions } from '../options'; -import { Intent, SignedIntent } from '../types'; +import { Intent, IntentWithMessage } from '../types'; import { IdempotencyKey } from '../keys/idempotency'; import { generateRendezvousKeypair } from '../keys/rendezvous'; /** * An abstract class for an intent that can be created and signed. */ -abstract class AbstractIntent implements Intent { +abstract class BaseIntent implements Intent { options: ElementOptions; nonce: IdempotencyKey; @@ -27,7 +27,7 @@ abstract class AbstractIntent implements Intent { ...opt, }; - this.init(); + this.init(opt); this.validate(); // Create an 11 byte buffer from idempotencyKey if provided, otherwise generate a random nonce @@ -43,28 +43,10 @@ abstract class AbstractIntent implements Intent { this.rendezvousKeypair = generateRendezvousKeypair(this.rendezvousPayload) } - abstract init(): void; + abstract init(opt: ElementOptions): void; abstract toPayload(): CodePayload; abstract validate(): void; - abstract toProto(): proto.Message; - abstract sign(): SignedIntent; - - /** - * Constructs a SendMessageRequest message to be sent to the Code Sequencer. - */ - async getSendMessageRequestProto() { - const { signature, envelope } = this.sign(); - - return new proto.SendMessageRequest({ - message: envelope, - rendezvousKey: { - value: this.rendezvousKeypair.getPublicKey().value, - }, - signature: { - value: signature, - } - }); - } + abstract hasMessage(): boolean; /** * Retrieves the client secret. @@ -85,6 +67,24 @@ abstract class AbstractIntent implements Intent { } } +/** + * Constructs a SendMessageRequest message to be sent to the Code Sequencer. + */ +async function getSendMessageRequestProto(intent: IntentWithMessage) { + const { signature, envelope } = intent.sign(); + + return new proto.SendMessageRequest({ + message: envelope, + rendezvousKey: { + value: intent.rendezvousKeypair.getPublicKey().value, + }, + signature: { + value: signature, + } + }); +} + export { - AbstractIntent, + BaseIntent, + getSendMessageRequestProto, } \ No newline at end of file diff --git a/packages/intents/src/intents/LoginRequestIntent.ts b/packages/intents/src/intents/LoginRequestIntent.ts index d6ba573..9882fe8 100644 --- a/packages/intents/src/intents/LoginRequestIntent.ts +++ b/packages/intents/src/intents/LoginRequestIntent.ts @@ -2,8 +2,8 @@ import * as proto from '@code-wallet/rpc'; import { Keypair, PublicKey } from '@code-wallet/keys'; import { CodePayload, CodeKind } from '@code-wallet/kikcode'; -import { AbstractIntent } from './AbstractIntent'; -import { SignedIntent } from '../types'; +import { BaseIntent, getSendMessageRequestProto } from './BaseIntent'; +import { IntentWithMessage, SignedIntent } from '../types'; import { ElementOptions, LoginRequestOptions } from '../options'; import { ErrLoginDomainRequired, @@ -16,15 +16,15 @@ import { validateElementOptions } from '../utils/validate'; /** * Represents a login request and provides methods to construct, validate, and sign the request. */ -class LoginRequestIntent extends AbstractIntent { +class LoginRequestIntent extends BaseIntent implements IntentWithMessage { domain: string; verifier: PublicKey; signer?: Keypair; /** - * Constructs a new PaymentRequestIntent instance. + * Constructs a new LoginRequestIntent instance. * - * @param opt - The payment request options. + * @param opt - The login request options. */ constructor(opt: LoginRequestOptions & ElementOptions) { super({ @@ -43,6 +43,10 @@ class LoginRequestIntent extends AbstractIntent { } } + hasMessage(): boolean { + return true; + } + init(): void { // noop } @@ -133,6 +137,10 @@ class LoginRequestIntent extends AbstractIntent { signature, } } + + getSendMessageRequestProto(): Promise { + return getSendMessageRequestProto(this); + } } export { diff --git a/packages/intents/src/intents/PaymentRequestIntent.ts b/packages/intents/src/intents/PaymentRequestIntent.ts index 8409520..6338732 100644 --- a/packages/intents/src/intents/PaymentRequestIntent.ts +++ b/packages/intents/src/intents/PaymentRequestIntent.ts @@ -3,8 +3,8 @@ import { PublicKey } from '@code-wallet/keys'; import { CurrencyCode, Kin } from '@code-wallet/currency'; import { CodePayload, CodeKind } from '@code-wallet/kikcode'; -import { AbstractIntent } from './AbstractIntent'; -import { SignedIntent } from '../types'; +import { BaseIntent, getSendMessageRequestProto } from './BaseIntent'; +import { IntentWithMessage, SignedIntent } from '../types'; import { ElementOptions, PaymentRequestOptions, } from '../options'; import { ErrAmountRequired, @@ -17,7 +17,7 @@ import { validateElementOptions } from '../utils/validate'; /** * Represents a payment request and provides methods to construct, validate, and sign the request. */ -class PaymentRequestIntent extends AbstractIntent { +class PaymentRequestIntent extends BaseIntent implements IntentWithMessage { convertedAmount: number | undefined; /** @@ -36,6 +36,10 @@ class PaymentRequestIntent extends AbstractIntent { }); } + hasMessage(): boolean { + return true; + } + init(): void { // We need to be very careful with floating point numbers. Ideally, we // would use a whole number and remainder as two bigints, or even a @@ -187,6 +191,10 @@ class PaymentRequestIntent extends AbstractIntent { signature, } } + + getSendMessageRequestProto(): Promise { + return getSendMessageRequestProto(this); + } } export { diff --git a/packages/intents/src/intents/TipRequestIntent.ts b/packages/intents/src/intents/TipRequestIntent.ts new file mode 100644 index 0000000..f85c83f --- /dev/null +++ b/packages/intents/src/intents/TipRequestIntent.ts @@ -0,0 +1,75 @@ +import { CodePayload, CodeKind } from '@code-wallet/kikcode'; + +import { BaseIntent } from './BaseIntent'; +import { ElementOptions, ExternalPlatformOptions } from '../options'; +import { + ErrExpectedPlatformName, + ErrExpectedUsername, + ErrPlatformRequired, +} from '../errors'; +import { validateElementOptions } from '../utils/validate'; + +/** + * Represents a login request and provides methods to construct, validate, and sign the request. + */ +class TipRequestIntent extends BaseIntent { + username: string = ''; + platform: string = ''; + + /** + * Constructs a new TipRequestIntent instance. + * + * @param opt - The tip request options. + */ + constructor(opt: ExternalPlatformOptions & ElementOptions) { + super({ + ...opt, + mode: 'tip', + }); + } + + hasMessage(): boolean { + return false; + } + + init(opt: ElementOptions): void { + const { username, name } = (opt as ExternalPlatformOptions).platform; + + this.username = username; + this.platform = name; + } + + toPayload(): CodePayload { + // See payload encoding for CodeKind.Tip + const kind = CodeKind.Tip; + const username = this.username; + + // Create a rendezvous payload and derive a keypair from it + return new CodePayload({ kind, username, }); + } + + /** + * Validates the payment request options. + */ + validate() { + validateElementOptions(this.options); + + if (!this.options.platform) { + throw ErrPlatformRequired(); + } + + if (!this.options.platform.name) { + throw ErrExpectedPlatformName(); + } + + if (!this.options.platform.username) { + throw ErrExpectedUsername(); + } + + } + +} + +export { + TipRequestIntent, +} \ No newline at end of file diff --git a/packages/intents/src/intents/index.ts b/packages/intents/src/intents/index.ts index 2f17fd2..3d6f084 100644 --- a/packages/intents/src/intents/index.ts +++ b/packages/intents/src/intents/index.ts @@ -1,3 +1,4 @@ export * from './PaymentRequestIntent'; export * from './PaymentRequestWithLoginIntent'; -export * from './LoginRequestIntent'; \ No newline at end of file +export * from './LoginRequestIntent'; +export * from './TipRequestIntent'; \ No newline at end of file diff --git a/packages/intents/src/options.ts b/packages/intents/src/options.ts index be037fd..c0bc3cd 100644 --- a/packages/intents/src/options.ts +++ b/packages/intents/src/options.ts @@ -4,12 +4,12 @@ import { Keypair } from '@code-wallet/keys'; /** * The mode of the intent. */ -export type IntentType = 'payment' | 'login'; +export type IntentType = 'payment' | 'login' | 'tip'; /** * Represents the possible types of elements. */ -export type ElementType = 'button' | 'card'; +export type ElementType = 'button' | 'page' | 'card'; /** * Describes the appearance themes for the element. @@ -117,6 +117,16 @@ export interface LoginRequestOptions { }; } +/** + * Defines the options needed for external platform integrations. + */ +export interface ExternalPlatformOptions { + platform: { + name: 'twitter', // At the moment, only Twitter is supported. + username: string; + } +} + /** * Describes the locale options for the element. */ @@ -141,6 +151,7 @@ export type ElementOptions = Partial & Partial & Partial & Partial & + Partial & Partial & Partial & Partial & diff --git a/packages/intents/src/types.ts b/packages/intents/src/types.ts index 46b87e2..8147c74 100644 --- a/packages/intents/src/types.ts +++ b/packages/intents/src/types.ts @@ -5,7 +5,7 @@ import { ElementOptions } from './options'; import { IdempotencyKey } from './keys/idempotency'; /** - * An interface for an intent that can be created and signed. + * An interface for an intent that might have a message to send to the Code Sequencer, but not necessarily. */ export interface Intent { options: ElementOptions; @@ -18,7 +18,29 @@ export interface Intent { * Validate the details of this intent, and throw an error if they're invalid. */ validate(): void; + + /** + * Whether this intent has a message to send to the Code Sequencer. + */ + hasMessage(): boolean; + /** + * Get the client secret for this intent, which can be used to create linked browser elements. For example, the "Pay with Code" button. + * + * @returns {string} The client secret for this intent. + */ + getClientSecret(): string; + + /** + * Get the intent ID for this intent, which can be used to create linked browser elements or request status. + */ + getIntentId(): string; +} + +/** + * An interface for an object that can be serialized into a message to send to the Code Sequencer. + */ +export interface WithMessage { /** * Serialize this intent into a minimal message for sending to the Code Sequencer. */ @@ -37,19 +59,12 @@ export interface Intent { * @returns {SignedIntent} The signed intent. */ sign(): SignedIntent; - - /** - * Get the client secret for this intent, which can be used to create linked browser elements. For example, the "Pay with Code" button. - * - * @returns {string} The client secret for this intent. - */ - getClientSecret(): string; - - /** - * Get the intent ID for this intent, which can be used to create linked browser elements or request status. - */ - getIntentId(): string; } + +/** + * An intent that has a message to send to the Code Sequencer. + */ +export type IntentWithMessage = Intent & WithMessage; /** * An object containing a signed intent and its signature. diff --git a/packages/intents/src/utils/validate.ts b/packages/intents/src/utils/validate.ts index 6e7ad19..d2ea1bf 100644 --- a/packages/intents/src/utils/validate.ts +++ b/packages/intents/src/utils/validate.ts @@ -18,6 +18,9 @@ import { ErrLoginPortsNotSupported, ErrInvalidLoginDomain, ErrLoginExpectedDomainName, + ErrPlatformRequired, + ErrExpectedPlatformName, + ErrExpectedUsername, } from '../errors'; /** @@ -145,6 +148,28 @@ function validateLoginRequestOptions(intent: ElementOptions) { PublicKey.fromBase58(intent.login.verifier); } +/** + * Validates the tip request options. + * + * @param intent The options to validate. + * @throws {ErrPlatformRequired} If the `platform` property is undefined. + * @throws {ErrExpectedPlatformName} If the `platform.name` property is undefined. + * @throws {ErrExpectedUsername} If the `platform.username` property is undefined. + */ +function validateTipRequestOptions(intent: ElementOptions) { + if (intent.platform === undefined) { + throw ErrPlatformRequired(); + } + + if (intent.platform.name === undefined) { + throw ErrExpectedPlatformName(); + } + + if (intent.platform.username === undefined) { + throw ErrExpectedUsername(); + } +} + /** * Validates the properties of the given `ElementOptions` for signers. */ @@ -185,6 +210,10 @@ function validateElementOptions(intent: ElementOptions) { if (intent.signers) { validateSigners(intent); } + break; + case 'tip': + validateTipRequestOptions(intent); + break; default: throw ErrInvalidMode(); diff --git a/packages/kikcode/package.json b/packages/kikcode/package.json index 10519bb..3b3808c 100644 --- a/packages/kikcode/package.json +++ b/packages/kikcode/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/kikcode", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "repository": { "type": "git", @@ -29,6 +29,7 @@ "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", + "@noble/hashes": "^1.3.2", "chai": "^4.3.8", "ts-mocha": "^10.0.0", "ts-node": "^10.9.1", diff --git a/packages/kikcode/src/errors.ts b/packages/kikcode/src/errors.ts index d4f7efb..88b7be6 100644 --- a/packages/kikcode/src/errors.ts +++ b/packages/kikcode/src/errors.ts @@ -1,7 +1,11 @@ const ErrInvalidSize = () => new Error("invalid size"); const ErrInvalidValue = () => new Error("invalid value"); +const ErrInvalidUsername = () => new Error("invalid username"); +const ErrInvalidNonce = () => new Error("invalid nonce"); export { ErrInvalidSize, ErrInvalidValue, + ErrInvalidUsername, + ErrInvalidNonce, }; diff --git a/packages/kikcode/src/payload.ts b/packages/kikcode/src/payload.ts index 564aad5..0b4c172 100644 --- a/packages/kikcode/src/payload.ts +++ b/packages/kikcode/src/payload.ts @@ -1,12 +1,15 @@ +import { sha256 } from '@noble/hashes/sha256'; +import { bytesToBase64 } from './utils'; + import { CurrencyCode, currencyCodeToIndex, indexToCurrencyCode, isValidCurrency, - ErrInvalidCurrency + ErrInvalidCurrency, } from "@code-wallet/currency"; -import { ErrInvalidSize, ErrInvalidValue } from "./errors"; +import { ErrInvalidSize, ErrInvalidValue, ErrInvalidUsername, ErrInvalidNonce } from "./errors"; import { CodeKind, CodePayloadOptions } from "./types"; /** @@ -15,9 +18,11 @@ import { CodeKind, CodePayloadOptions } from "./types"; */ class CodePayload { kind: CodeKind; - nonce: Uint8Array; + + nonce?: Uint8Array; amount?: bigint; currency?: CurrencyCode; + username?: string; static readonly MAX_LENGTH: number = 20; @@ -28,8 +33,9 @@ class CodePayload { */ constructor(opt: CodePayloadOptions) { this.kind = opt.kind; - this.amount = opt.amount; this.nonce = opt.nonce; + this.amount = opt.amount; + this.username = opt.username; if (opt.currency && !isValidCurrency(opt.currency)) { throw ErrInvalidCurrency(); @@ -53,6 +59,10 @@ class CodePayload { return this.kind === CodeKind.RequestPaymentWithFeesSupport && this.currency != null && this.amount != null; } + private isTip(): this is this & { username: string } { + return this.kind === CodeKind.Tip && this.username != null; + } + /** * Validates the payload, throwing an error if invalid. */ @@ -70,6 +80,20 @@ class CodePayload { throw ErrInvalidValue(); } } + + if (this.kind === CodeKind.Tip) { + if (!this.username) { + throw ErrInvalidUsername(); + } + + if (this.username.length > 15) { + throw ErrInvalidUsername(); + } + } + + if (this.kind !== CodeKind.Tip && (!this.nonce || this.nonce.length !== 11)) { + throw ErrInvalidNonce(); + } } /** @@ -103,8 +127,42 @@ class CodePayload { } } - data.set(this.nonce, 9); - + if (this.isTip()) { + const usernameBuffer = new TextEncoder().encode(this.username); + const maxLength = 15; + const sanitizedUsername = usernameBuffer.slice(0, maxLength); + data.set(sanitizedUsername, 5); + + const paddingRequired = maxLength - sanitizedUsername.length; + let padding = ""; + if (paddingRequired > 0) { + padding = "."; + } + + if (paddingRequired > 1) { + const hash = sha256(usernameBuffer); + + // Buffer is not available in browser environment + // const encoded = Buffer.from(hash).toString('base64'); + const encoded = bytesToBase64(hash); + + padding = `${padding}${encoded.slice(0, paddingRequired - 1)}`; + } + + if (padding.length > 0) { + //console.log(padding, padding.length, paddingRequired) + const paddingBuffer = new TextEncoder().encode(padding); + data.set(paddingBuffer, 5 + sanitizedUsername.length); + } + + return data; + } + + // for Cash, Gift Card, Logins, and Payment Request + if (this.nonce) { + data.set(this.nonce, 9); + } + return data; } @@ -120,12 +178,14 @@ class CodePayload { } const kind = data[0] as CodeKind; - let amount: bigint | undefined; let nonce: Uint8Array; + + let amount: bigint | undefined; let currency: CurrencyCode | undefined; + let username: string | undefined; if (kind === CodeKind.RequestPayment || kind === CodeKind.RequestPaymentWithFeesSupport) { - // for Payment Request + // for Payment request const currencyIndex = data[1]; currency = indexToCurrencyCode(currencyIndex); amount = data.slice(2, 9).reduce((acc, val, i) => acc + (BigInt(val) << BigInt(8 * i)), BigInt(0)); @@ -135,10 +195,22 @@ class CodePayload { // for Cash and Gift Card amount = data.slice(1, 9).reduce((acc, val, i) => acc + (BigInt(val) << BigInt(8 * i)), BigInt(0)); } + + if (kind === CodeKind.Tip) { + // for Tip request + username = new TextDecoder().decode(data.slice(5, 20)).split(".")[0]; + return new CodePayload({ kind, username, nonce: new Uint8Array(11) }); + } nonce = data.slice(9); - return new CodePayload({ kind, amount, currency, nonce }); + return new CodePayload({ + kind, + nonce, + amount, + currency, + username, + }); } } diff --git a/packages/kikcode/src/types.ts b/packages/kikcode/src/types.ts index 695cb24..3ce2dc0 100644 --- a/packages/kikcode/src/types.ts +++ b/packages/kikcode/src/types.ts @@ -1,12 +1,7 @@ import { CurrencyCode } from '@code-wallet/currency'; /* -Scan Code Payload Format - -The payload is a 20-byte binary blob that contains the data for the scan code -before it is encoded. - -Layout 0: Cash + Layout 0: Cash 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ @@ -29,13 +24,11 @@ Layout 0: Cash This field is an 11-byte randomly-generated nonce. It should be regenerated each time a new payment is initiated. - -Layout 1: Gift Card + Layout 1: Gift Card Same as layout 0. - -Layout 2: Payment Request + Layout 2: Payment Request 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ @@ -55,13 +48,38 @@ Layout 2: Payment Request Fiat Amount (7 bytes) - This field indicates the number of quarks the payment is for. It should be - represented as a 64-bit unsigned integer. + This field indicates the fiat amount, denominated in `Currency` above. The amount + is an integer value calculated as follows: $5.00 x 100 = 500. The decimals are + offset by multiplying by 100 and encoding the integer result. When decoding, the + amount should be divided by 100 again to return the original value. Nonce (11 bytes) This field is an 11-byte randomly-generated nonce. It should be regenerated each time a new payment is initiated. + + Layout 5: Tip + + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + | T | Flags | username | ... remainder (0) | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + + (T) Type (1 byte) + + The first byte of the data in all Code scan codes is reserved for the scan + code type. This field indicates which type of scan code data is contained + in the scan code. + + (F) Flags (4 bytes) + + Optional flags may provide additional context on the type of username embedded in + the scan code. + + Username (15 bytes) + + The username that uniquely represents a user's tip code. Cannot be longer than 15 + bytes. Any additional space is represented by an empty string in (remainder). */ /** @@ -72,12 +90,14 @@ export enum CodeKind { GiftCard = 1, RequestPayment = 2, RequestLogin = 3, - RequestPaymentWithFeesSupport = 4 + RequestPaymentWithFeesSupport = 4, + Tip = 5, } export interface CodePayloadOptions { kind: CodeKind; - nonce: Uint8Array; + nonce?: Uint8Array; amount?: bigint; currency?: CurrencyCode; + username?: string; } \ No newline at end of file diff --git a/packages/kikcode/src/utils.ts b/packages/kikcode/src/utils.ts new file mode 100644 index 0000000..8c207b9 --- /dev/null +++ b/packages/kikcode/src/utils.ts @@ -0,0 +1,94 @@ +const base64abc = [ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', + 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', + + // The following characters are based on the + // Buffer.from('').toString('base64') standard + '+', '/', +] + +const base64codes = (() => { + const l = 256 + const base64codes = new Uint8Array(l) + for (let i = 0; i < l; ++i) { + base64codes[i] = 255 // invalid character + } + base64abc.forEach((char, index) => { + base64codes[char.charCodeAt(0)] = index + }) + base64codes['='.charCodeAt(0)] = 0 // ignored anyway, so we just need to prevent an error + return base64codes +})() + +function getBase64Code(charCode: number) { + if (charCode >= base64codes.length) { + throw new Error('Unable to parse base64 string (code beyond length).') + } + const code = base64codes[charCode]! + if (code === 255) { + throw new Error('Unable to parse base64 string (invalid code).') + } + return code +} + +export function bytesToBase64(bytes: Uint8Array) { + let result = '', + i, + l = bytes.length + for (i = 2; i < l; i += 3) { + result += base64abc[bytes[i - 2]! >> 2] + result += base64abc[((bytes[i - 2]! & 0x03) << 4) | (bytes[i - 1]! >> 4)] + result += base64abc[((bytes[i - 1]! & 0x0f) << 2) | (bytes[i]! >> 6)] + result += base64abc[bytes[i]! & 0x3f] + } + if (i === l + 1) { + // 1 octet yet to write + result += base64abc[bytes[i - 2]! >> 2] + result += base64abc[(bytes[i - 2]! & 0x03) << 4] + result += '==' + } + if (i === l) { + // 2 octets yet to write + result += base64abc[bytes[i - 2]! >> 2] + result += base64abc[((bytes[i - 2]! & 0x03) << 4) | (bytes[i - 1]! >> 4)] + result += base64abc[(bytes[i - 1]! & 0x0f) << 2] + result += '=' + } + return result +} + +export function base64ToBytes(str: string) { + if (str.length % 4 !== 0) { + throw new Error('Unable to parse base64 string (invalid length).') + } + const index = str.indexOf('=') + if (index !== -1 && index < str.length - 2) { + throw new Error('Unable to parse base64 string (octets).') + } + let missingOctets = str.endsWith('==') ? 2 : str.endsWith('=') ? 1 : 0, + n = str.length, + result = new Uint8Array(3 * (n / 4)), + buffer + for (let i = 0, j = 0; i < n; i += 4, j += 3) { + buffer = + (getBase64Code(str.charCodeAt(i)) << 18) | + (getBase64Code(str.charCodeAt(i + 1)) << 12) | + (getBase64Code(str.charCodeAt(i + 2)) << 6) | + getBase64Code(str.charCodeAt(i + 3)) + result[j] = buffer >> 16 + result[j + 1] = (buffer >> 8) & 0xff + result[j + 2] = buffer & 0xff + } + return result.subarray(0, result.length - missingOctets) +} + +export function base64encode(str: string, encoder = new TextEncoder()) { + return bytesToBase64(encoder.encode(str)) +} + +export function base64decode(str: string, decoder = new TextDecoder()) { + return decoder.decode(base64ToBytes(str)) +} \ No newline at end of file diff --git a/packages/kikcode/test/encode.test.ts b/packages/kikcode/test/encode.test.ts index fcad3fc..98bdf62 100644 --- a/packages/kikcode/test/encode.test.ts +++ b/packages/kikcode/test/encode.test.ts @@ -18,4 +18,31 @@ describe('payload encoding', () => { expect(key).to.deep.equal(decoded); }); + it('should encode and decode a tip payload (no dot)', async () => { + const key = new Uint8Array([ + 0x05, 0x00, 0x00, 0x00, 0x00, + 0x67, 0x65, 0x74, 0x63, 0x6f, + 0x64, 0x65, 0x2e, 0x34, 0x56, + 0x71, 0x2f, 0x72, 0x2b, 0x58, + ]); + + const encoded = await encode(key); + const decoded = await decode(encoded); + + expect(key).to.deep.equal(decoded); + }); + + it('should encode and decode a tip payload (with dot)', async () => { + const key = new Uint8Array([ + 0x05, 0x00, 0x00, 0x00, 0x00, + 0x62, 0x6f, 0x62, 0x5f, 0x62, + 0x65, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x74, 0x6f, 0x6e, 0x2e, + ]); + + const encoded = await encode(key); + const decoded = await decode(encoded); + + expect(key).to.deep.equal(decoded); + }); }); \ No newline at end of file diff --git a/packages/kikcode/test/payload.test.ts b/packages/kikcode/test/payload.test.ts index b87c8b6..852d2e9 100644 --- a/packages/kikcode/test/payload.test.ts +++ b/packages/kikcode/test/payload.test.ts @@ -35,6 +35,21 @@ describe('CodePayload', () => { 0x07, 0x08, 0x09, 0x10, 0x11 ]) + const sampleTip = new Uint8Array([ + 0x05, 0x00, 0x00, 0x00, 0x00, + 0x67, 0x65, 0x74, 0x63, 0x6f, + 0x64, 0x65, 0x2e, 0x34, 0x56, + 0x71, 0x2f, 0x72, 0x2b, 0x58, + ]); + + const sampleTipDot = new Uint8Array([ + 0x05, 0x00, 0x00, 0x00, 0x00, + 0x62, 0x6f, 0x62, 0x5f, 0x62, + 0x65, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x74, 0x6f, 0x6e, 0x2e, + ]); + + it('should create new payload from parameters', () => { const kind = CodeKind.Cash; const amount = BigInt(100); @@ -170,4 +185,45 @@ describe('CodePayload', () => { expect(binaryData.length).to.equal(CodePayload.MAX_LENGTH); }); + + it('should encode standard username', () => { + + const payload = new CodePayload({ + kind: CodeKind.Tip, + username: "getcode" + }); + const encoded = payload.toBinary(); + + expect(encoded.toString()).to.eql(sampleTip.toString()); + }); + + it('should encode single pad username', () => { + const payload = new CodePayload({ + kind: CodeKind.Tip, + username: "bob_bennington" + }); + const encoded = payload.toBinary(); + + expect(encoded.toString()).to.eql(sampleTipDot.toString()); + }); + + it('should throw when username is too long', () => { + try { + new CodePayload({ + kind: CodeKind.Tip, + username: "bob_benningtons" + }); + } + catch (e) { + expect(e.message).to.equal(ErrInvalidValue().message); + } + }); + + it('should decode username', () => { + const payload = CodePayload.fromData(sampleTip); + + expect(payload.kind).to.equal(CodeKind.Tip); + expect(payload.username).to.equal("getcode"); + expect(payload.nonce).to.eql(new Uint8Array(11)); + }); }); \ No newline at end of file diff --git a/packages/views/Makefile b/packages/views/Makefile index b56f03c..973374b 100644 --- a/packages/views/Makefile +++ b/packages/views/Makefile @@ -16,16 +16,38 @@ copy-sdk: @mkdir -p ./apps/dist/v1/elements/payment-request-button/ @mkdir -p ./apps/dist/v1/elements/payment-request-modal-desktop/ @mkdir -p ./apps/dist/v1/elements/payment-request-modal-mobile/ + @mkdir -p ./apps/dist/v1/elements/payment-request-page-desktop/ + @mkdir -p ./apps/dist/v1/elements/payment-request-page-mobile/ + @cp -r ./apps/payment-request-button/dist/* ./apps/dist/v1/elements/payment-request-button/ @cp -r ./apps/payment-request-modal-desktop/dist/* ./apps/dist/v1/elements/payment-request-modal-desktop/ @cp -r ./apps/payment-request-modal-mobile/dist/* ./apps/dist/v1/elements/payment-request-modal-mobile/ + @cp -r ./apps/payment-request-page-desktop/dist/* ./apps/dist/v1/elements/payment-request-page-desktop/ + @cp -r ./apps/payment-request-page-mobile/dist/* ./apps/dist/v1/elements/payment-request-page-mobile/ @mkdir -p ./apps/dist/v1/elements/login-request-button/ @mkdir -p ./apps/dist/v1/elements/login-request-modal-desktop/ @mkdir -p ./apps/dist/v1/elements/login-request-modal-mobile/ + @mkdir -p ./apps/dist/v1/elements/login-request-page-desktop/ + @mkdir -p ./apps/dist/v1/elements/login-request-page-mobile/ + @cp -r ./apps/login-request-button/dist/* ./apps/dist/v1/elements/login-request-button/ @cp -r ./apps/login-request-modal-desktop/dist/* ./apps/dist/v1/elements/login-request-modal-desktop/ @cp -r ./apps/login-request-modal-mobile/dist/* ./apps/dist/v1/elements/login-request-modal-mobile/ + @cp -r ./apps/login-request-page-desktop/dist/* ./apps/dist/v1/elements/login-request-page-desktop/ + @cp -r ./apps/login-request-page-mobile/dist/* ./apps/dist/v1/elements/login-request-page-mobile/ + + @mkdir -p ./apps/dist/v1/elements/tips-request-button/ + @mkdir -p ./apps/dist/v1/elements/tips-request-modal-desktop/ + @mkdir -p ./apps/dist/v1/elements/tips-request-modal-mobile/ + @mkdir -p ./apps/dist/v1/elements/tips-request-page-desktop/ + @mkdir -p ./apps/dist/v1/elements/tips-request-page-mobile/ + + @cp -r ./apps/tips-request-button/dist/* ./apps/dist/v1/elements/tips-request-button/ + @cp -r ./apps/tips-request-modal-desktop/dist/* ./apps/dist/v1/elements/tips-request-modal-desktop/ + @cp -r ./apps/tips-request-modal-mobile/dist/* ./apps/dist/v1/elements/tips-request-modal-mobile/ + @cp -r ./apps/tips-request-page-desktop/dist/* ./apps/dist/v1/elements/tips-request-page-desktop/ + @cp -r ./apps/tips-request-page-mobile/dist/* ./apps/dist/v1/elements/tips-request-page-mobile/ .PHONY: build build: build-sdk copy-sdk \ No newline at end of file diff --git a/packages/views/apps/index.html b/packages/views/apps/index.html index 0d6e3c7..699fb10 100644 --- a/packages/views/apps/index.html +++ b/packages/views/apps/index.html @@ -6,11 +6,24 @@ + + + + + + + + + + + + + diff --git a/packages/views/apps/login-request-button/index.js b/packages/views/apps/login-request-button/index.js index 3fd3a6d..56c627f 100644 --- a/packages/views/apps/login-request-button/index.js +++ b/packages/views/apps/login-request-button/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/login-request-button' +import { routes } from '../../src/routes/buttons/login-request-button' import './style.css' diff --git a/packages/views/apps/login-request-modal-desktop/index.js b/packages/views/apps/login-request-modal-desktop/index.js index 5396c11..f7ee27d 100644 --- a/packages/views/apps/login-request-modal-desktop/index.js +++ b/packages/views/apps/login-request-modal-desktop/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/login-request-modal-desktop' +import { routes } from '../../src/routes/modals/login-request-modal-desktop' import './style.css' diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/App.vue b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.html b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.js b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.js new file mode 100644 index 0000000..f700a4b --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/login-request-modal-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/style.css b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/vite.config.ts b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/vite.config.ts new file mode 100644 index 0000000..3be6c3c --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/login-request-modal-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/App.vue b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.html b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.js b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.js new file mode 100644 index 0000000..d97ae4b --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/payment-request-modal-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/style.css b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/vite.config.ts b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/vite.config.ts new file mode 100644 index 0000000..88f31a6 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/payment-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/App.vue b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.html b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.js b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.js new file mode 100644 index 0000000..6a28b36 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/payment-request-modal-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/style.css b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/vite.config.ts b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/vite.config.ts new file mode 100644 index 0000000..4615813 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/payment-request-modal-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/payment-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/App.vue b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.html b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.js b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.js new file mode 100644 index 0000000..c4a0959 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/tip-request-modal-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/style.css b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/vite.config.ts b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/vite.config.ts new file mode 100644 index 0000000..b290c14 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/App.vue b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.html b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.js b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.js new file mode 100644 index 0000000..833c37b --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/tip-request-modal-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/style.css b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/vite.config.ts b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/vite.config.ts new file mode 100644 index 0000000..3be6c3c --- /dev/null +++ b/packages/views/apps/login-request-modal-desktop/tip-request-modal-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-modal-mobile/index.js b/packages/views/apps/login-request-modal-mobile/index.js index 6484e70..f700a4b 100644 --- a/packages/views/apps/login-request-modal-mobile/index.js +++ b/packages/views/apps/login-request-modal-mobile/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/login-request-modal-mobile' +import { routes } from '../../src/routes/modals/login-request-modal-mobile' import './style.css' diff --git a/packages/views/apps/login-request-page-desktop/App.vue b/packages/views/apps/login-request-page-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-page-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/login-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/login-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/login-request-page-desktop/index.html b/packages/views/apps/login-request-page-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-page-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-page-desktop/index.js b/packages/views/apps/login-request-page-desktop/index.js new file mode 100644 index 0000000..7c0aceb --- /dev/null +++ b/packages/views/apps/login-request-page-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/login-request-page-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-page-desktop/style.css b/packages/views/apps/login-request-page-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/login-request-page-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-page-desktop/vite.config.ts b/packages/views/apps/login-request-page-desktop/vite.config.ts new file mode 100644 index 0000000..b290c14 --- /dev/null +++ b/packages/views/apps/login-request-page-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/login-request-page-mobile/App.vue b/packages/views/apps/login-request-page-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/login-request-page-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/login-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/login-request-page-mobile/index.html b/packages/views/apps/login-request-page-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/login-request-page-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/login-request-page-mobile/index.js b/packages/views/apps/login-request-page-mobile/index.js new file mode 100644 index 0000000..2985d1d --- /dev/null +++ b/packages/views/apps/login-request-page-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/login-request-page-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/login-request-page-mobile/style.css b/packages/views/apps/login-request-page-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/login-request-page-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/login-request-page-mobile/vite.config.ts b/packages/views/apps/login-request-page-mobile/vite.config.ts new file mode 100644 index 0000000..3be6c3c --- /dev/null +++ b/packages/views/apps/login-request-page-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/payment-request-button/index.js b/packages/views/apps/payment-request-button/index.js index 6707247..0a49aac 100644 --- a/packages/views/apps/payment-request-button/index.js +++ b/packages/views/apps/payment-request-button/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/payment-request-button' +import { routes } from '../../src/routes/buttons/payment-request-button' import './style.css' diff --git a/packages/views/apps/payment-request-modal-desktop/index.js b/packages/views/apps/payment-request-modal-desktop/index.js index 3eebff1..d97ae4b 100644 --- a/packages/views/apps/payment-request-modal-desktop/index.js +++ b/packages/views/apps/payment-request-modal-desktop/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/payment-request-modal-desktop' +import { routes } from '../../src/routes/modals/payment-request-modal-desktop' import './style.css' diff --git a/packages/views/apps/payment-request-modal-mobile/index.js b/packages/views/apps/payment-request-modal-mobile/index.js index 03f13f9..6a28b36 100644 --- a/packages/views/apps/payment-request-modal-mobile/index.js +++ b/packages/views/apps/payment-request-modal-mobile/index.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import App from './App.vue' import CodeApp from '../../src/index' -import { routes } from '../../src/routes/payment-request-modal-mobile' +import { routes } from '../../src/routes/modals/payment-request-modal-mobile' import './style.css' diff --git a/packages/views/apps/payment-request-page-desktop/App.vue b/packages/views/apps/payment-request-page-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/payment-request-page-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/payment-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/payment-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/payment-request-page-desktop/index.html b/packages/views/apps/payment-request-page-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/payment-request-page-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/payment-request-page-desktop/index.js b/packages/views/apps/payment-request-page-desktop/index.js new file mode 100644 index 0000000..2746e7d --- /dev/null +++ b/packages/views/apps/payment-request-page-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/payment-request-page-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/payment-request-page-desktop/style.css b/packages/views/apps/payment-request-page-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/payment-request-page-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/payment-request-page-desktop/vite.config.ts b/packages/views/apps/payment-request-page-desktop/vite.config.ts new file mode 100644 index 0000000..88f31a6 --- /dev/null +++ b/packages/views/apps/payment-request-page-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/payment-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/payment-request-page-mobile/App.vue b/packages/views/apps/payment-request-page-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/payment-request-page-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/payment-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/payment-request-page-mobile/index.html b/packages/views/apps/payment-request-page-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/payment-request-page-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/payment-request-page-mobile/index.js b/packages/views/apps/payment-request-page-mobile/index.js new file mode 100644 index 0000000..11a2c11 --- /dev/null +++ b/packages/views/apps/payment-request-page-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/payment-request-page-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/payment-request-page-mobile/style.css b/packages/views/apps/payment-request-page-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/payment-request-page-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/payment-request-page-mobile/vite.config.ts b/packages/views/apps/payment-request-page-mobile/vite.config.ts new file mode 100644 index 0000000..4615813 --- /dev/null +++ b/packages/views/apps/payment-request-page-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/payment-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/tip-request-button/App.vue b/packages/views/apps/tip-request-button/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/tip-request-button/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/tip-request-button/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/tip-request-button/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/tip-request-button/index.html b/packages/views/apps/tip-request-button/index.html new file mode 100644 index 0000000..20ac7df --- /dev/null +++ b/packages/views/apps/tip-request-button/index.html @@ -0,0 +1,78 @@ + + + + + + Code SDK - Button + + + + +
+ + + + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/packages/views/apps/tip-request-button/index.js b/packages/views/apps/tip-request-button/index.js new file mode 100644 index 0000000..bb47b55 --- /dev/null +++ b/packages/views/apps/tip-request-button/index.js @@ -0,0 +1,16 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/buttons/tip-request-button' + +import './style.css' + +const opt = { + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/tip-request-button/style.css b/packages/views/apps/tip-request-button/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/tip-request-button/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/tip-request-button/vite.config.ts b/packages/views/apps/tip-request-button/vite.config.ts new file mode 100644 index 0000000..2529285 --- /dev/null +++ b/packages/views/apps/tip-request-button/vite.config.ts @@ -0,0 +1,51 @@ +import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'; +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-button/', + plugins: [ + vue(), + cssInjectedByJsPlugin(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8780, + }, +}) diff --git a/packages/views/apps/tip-request-modal-desktop/App.vue b/packages/views/apps/tip-request-modal-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/tip-request-modal-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/tip-request-modal-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/tip-request-modal-desktop/index.html b/packages/views/apps/tip-request-modal-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/tip-request-modal-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/tip-request-modal-desktop/index.js b/packages/views/apps/tip-request-modal-desktop/index.js new file mode 100644 index 0000000..c4a0959 --- /dev/null +++ b/packages/views/apps/tip-request-modal-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/tip-request-modal-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/tip-request-modal-desktop/style.css b/packages/views/apps/tip-request-modal-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/tip-request-modal-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/tip-request-modal-desktop/vite.config.ts b/packages/views/apps/tip-request-modal-desktop/vite.config.ts new file mode 100644 index 0000000..b290c14 --- /dev/null +++ b/packages/views/apps/tip-request-modal-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/tip-request-modal-mobile/App.vue b/packages/views/apps/tip-request-modal-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/tip-request-modal-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/tip-request-modal-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/tip-request-modal-mobile/index.html b/packages/views/apps/tip-request-modal-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/tip-request-modal-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/tip-request-modal-mobile/index.js b/packages/views/apps/tip-request-modal-mobile/index.js new file mode 100644 index 0000000..833c37b --- /dev/null +++ b/packages/views/apps/tip-request-modal-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/modals/tip-request-modal-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/tip-request-modal-mobile/style.css b/packages/views/apps/tip-request-modal-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/tip-request-modal-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/tip-request-modal-mobile/vite.config.ts b/packages/views/apps/tip-request-modal-mobile/vite.config.ts new file mode 100644 index 0000000..3be6c3c --- /dev/null +++ b/packages/views/apps/tip-request-modal-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/tip-request-page-desktop/App.vue b/packages/views/apps/tip-request-page-desktop/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/tip-request-page-desktop/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf b/packages/views/apps/tip-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf new file mode 100644 index 0000000..f6c149a Binary files /dev/null and b/packages/views/apps/tip-request-page-desktop/fonts/roboto/RobotoMono-Medium.ttf differ diff --git a/packages/views/apps/tip-request-page-desktop/index.html b/packages/views/apps/tip-request-page-desktop/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/tip-request-page-desktop/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/tip-request-page-desktop/index.js b/packages/views/apps/tip-request-page-desktop/index.js new file mode 100644 index 0000000..8c31913 --- /dev/null +++ b/packages/views/apps/tip-request-page-desktop/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/tip-request-page-desktop' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/tip-request-page-desktop/style.css b/packages/views/apps/tip-request-page-desktop/style.css new file mode 100644 index 0000000..78c9427 --- /dev/null +++ b/packages/views/apps/tip-request-page-desktop/style.css @@ -0,0 +1,54 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } + @font-face { + font-family: "Roboto Mono Medium"; + font-style: normal; + font-weight: 500; + font-display: block; + src: url(/fonts/roboto/RobotoMono-Medium.ttf) format("truetype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/tip-request-page-desktop/vite.config.ts b/packages/views/apps/tip-request-page-desktop/vite.config.ts new file mode 100644 index 0000000..b290c14 --- /dev/null +++ b/packages/views/apps/tip-request-page-desktop/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-desktop/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/tip-request-page-mobile/App.vue b/packages/views/apps/tip-request-page-mobile/App.vue new file mode 100644 index 0000000..d75d9b8 --- /dev/null +++ b/packages/views/apps/tip-request-page-mobile/App.vue @@ -0,0 +1,13 @@ + + + + diff --git a/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf new file mode 100644 index 0000000..2076a1f Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Demi.otf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf new file mode 100644 index 0000000..660511b Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Medium.otf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf new file mode 100644 index 0000000..0ae7cee Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/avenir/AvenirNextLTPro-Regular.otf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Bold.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..8bbf0bd Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Bold.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..3f68dff Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraBold.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..9d21d77 Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-ExtraLight.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Light.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Light.ttf new file mode 100644 index 0000000..f255257 Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Light.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Medium.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..c73d774 Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Medium.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Regular.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..c02b01b Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-Regular.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..30ee031 Binary files /dev/null and b/packages/views/apps/tip-request-page-mobile/fonts/manrope/Manrope-SemiBold.ttf differ diff --git a/packages/views/apps/tip-request-page-mobile/index.html b/packages/views/apps/tip-request-page-mobile/index.html new file mode 100644 index 0000000..40b9874 --- /dev/null +++ b/packages/views/apps/tip-request-page-mobile/index.html @@ -0,0 +1,24 @@ + + + + + Code SDK - Card + + + +
+ + + + + + + + diff --git a/packages/views/apps/tip-request-page-mobile/index.js b/packages/views/apps/tip-request-page-mobile/index.js new file mode 100644 index 0000000..99a7af1 --- /dev/null +++ b/packages/views/apps/tip-request-page-mobile/index.js @@ -0,0 +1,17 @@ +import { createApp } from 'vue' + +import App from './App.vue' +import CodeApp from '../../src/index' +import { routes } from '../../src/routes/pages/tip-request-page-mobile' + +import './style.css' + +const opt = { + wsPath: process.env.WS_PATH, + httpPath: process.env.HTTP_PATH, + routes, +} + +const app = createApp(App); +app.use(CodeApp, opt); +app.mount("#app"); \ No newline at end of file diff --git a/packages/views/apps/tip-request-page-mobile/style.css b/packages/views/apps/tip-request-page-mobile/style.css new file mode 100644 index 0000000..702569c --- /dev/null +++ b/packages/views/apps/tip-request-page-mobile/style.css @@ -0,0 +1,47 @@ +/* ./src/index.css */ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +@layer base { + @font-face { + font-family: "Avenir Next LT Pro Regular"; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Regular.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Medium"; + font-style: normal; + font-weight: 600; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Medium.otf) format("opentype"); + } + @font-face { + font-family: "Avenir Next LT Pro Bold"; + font-style: normal; + font-weight: 900; + font-display: block; + src: url(/fonts/avenir/AvenirNextLTPro-Demi.otf) format("opentype"); + } +} + +:root { + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color-scheme: light dark; + color: #555; + + font-family: 'Avenir Next LT Pro Regular', sans-serif; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + diff --git a/packages/views/apps/tip-request-page-mobile/vite.config.ts b/packages/views/apps/tip-request-page-mobile/vite.config.ts new file mode 100644 index 0000000..3be6c3c --- /dev/null +++ b/packages/views/apps/tip-request-page-mobile/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import path from 'path'; +import { config } from 'dotenv'; + +config(); + +let env = {} as { WS_PATH: string, HTTP_PATH: string }; +if (process.env.NODE_ENV === 'production') { + console.warn('Using production environment'); + env = { + WS_PATH: 'wss://cash.getcode.com', + HTTP_PATH: 'https://cash.getcode.com', + } +} else { + console.warn('Using dev environment'); + env = { + WS_PATH: 'ws://localhost:3000', + HTTP_PATH: 'http://localhost:3000', + }; +} + +// https://vitejs.dev/config/ +export default defineConfig({ + base: '/v1/elements/login-request-modal-mobile/', + plugins: [ + vue(), + ], + root: path.resolve(__dirname, './'), + resolve: { + alias: { + crypto: 'crypto-browserify', + process: "process/browser", + stream: "stream-browserify", + zlib: "browserify-zlib", + }, + }, + define: { + 'process.env': env, + 'process.browser': true, + 'global': {} + }, + build: { + chunkSizeWarningLimit: 1600, + }, + server: { + port: 8790, + }, +}) diff --git a/packages/views/apps/vite.config.ts b/packages/views/apps/vite.config.ts index 21be812..383b769 100644 --- a/packages/views/apps/vite.config.ts +++ b/packages/views/apps/vite.config.ts @@ -51,9 +51,20 @@ export default defineConfig({ 'payment-request-button': path.resolve(__dirname, 'payment-request-button', 'index.html'), 'payment-request-modal-desktop': path.resolve(__dirname, 'payment-request-modal-desktop', 'index.html'), 'payment-request-modal-mobile': path.resolve(__dirname, 'payment-request-modal-mobile', 'index.html'), + 'payment-request-page-desktop': path.resolve(__dirname, 'payment-request-page-desktop', 'index.html'), + 'payment-request-page-mobile': path.resolve(__dirname, 'payment-request-page-mobile', 'index.html'), + 'login-request-button': path.resolve(__dirname, 'login-request-button', 'index.html'), 'login-request-modal-desktop': path.resolve(__dirname, 'login-request-modal-desktop', 'index.html'), 'login-request-modal-mobile': path.resolve(__dirname, 'login-request-modal-mobile', 'index.html'), + 'login-request-page-desktop': path.resolve(__dirname, 'login-request-page-desktop', 'index.html'), + 'login-request-page-mobile': path.resolve(__dirname, 'login-request-page-mobile', 'index.html'), + + 'tips-request-button': path.resolve(__dirname, 'tips-request-button', 'index.html'), + 'tips-request-modal-desktop': path.resolve(__dirname, 'tips-request-modal-desktop', 'index.html'), + 'tips-request-modal-mobile': path.resolve(__dirname, 'tips-request-modal-mobile', 'index.html'), + 'tips-request-page-desktop': path.resolve(__dirname, 'tips-request-page-desktop', 'index.html'), + 'tips-request-page-mobile': path.resolve(__dirname, 'tips-request-page-mobile', 'index.html'), } } }, diff --git a/packages/views/package.json b/packages/views/package.json index 0da1386..8b811ff 100644 --- a/packages/views/package.json +++ b/packages/views/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/views", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "repository": { "type": "git", diff --git a/packages/views/src/components/elements/CodeRequestLogin.vue b/packages/views/src/components/cards/CodeRequestLogin.vue similarity index 95% rename from packages/views/src/components/elements/CodeRequestLogin.vue rename to packages/views/src/components/cards/CodeRequestLogin.vue index bd3677d..e284d68 100644 --- a/packages/views/src/components/elements/CodeRequestLogin.vue +++ b/packages/views/src/components/cards/CodeRequestLogin.vue @@ -1,7 +1,8 @@ + + + + \ No newline at end of file diff --git a/packages/views/src/components/elements/CodeSpinner.vue b/packages/views/src/components/common/CodeSpinner.vue similarity index 100% rename from packages/views/src/components/elements/CodeSpinner.vue rename to packages/views/src/components/common/CodeSpinner.vue diff --git a/packages/views/src/components/elements/DownloadAppQR.vue b/packages/views/src/components/common/DownloadAppQR.vue similarity index 100% rename from packages/views/src/components/elements/DownloadAppQR.vue rename to packages/views/src/components/common/DownloadAppQR.vue diff --git a/packages/views/src/components/elements/ErrorMessage.vue b/packages/views/src/components/common/ErrorMessage.vue similarity index 94% rename from packages/views/src/components/elements/ErrorMessage.vue rename to packages/views/src/components/common/ErrorMessage.vue index db398c5..3a578aa 100644 --- a/packages/views/src/components/elements/ErrorMessage.vue +++ b/packages/views/src/components/common/ErrorMessage.vue @@ -1,5 +1,5 @@ + + \ No newline at end of file diff --git a/packages/views/src/components/sdk/index.ts b/packages/views/src/components/sdk/index.ts deleted file mode 100644 index e1c3cf8..0000000 --- a/packages/views/src/components/sdk/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as CodeButton } from './CodeButton.vue' \ No newline at end of file diff --git a/packages/views/src/components/pages/LoginRequestModalDesktop.vue b/packages/views/src/components/sdk/modals/LoginRequestModalDesktop.vue similarity index 93% rename from packages/views/src/components/pages/LoginRequestModalDesktop.vue rename to packages/views/src/components/sdk/modals/LoginRequestModalDesktop.vue index 8776825..edd4051 100644 --- a/packages/views/src/components/pages/LoginRequestModalDesktop.vue +++ b/packages/views/src/components/sdk/modals/LoginRequestModalDesktop.vue @@ -1,11 +1,14 @@