@openreceive/vue 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenReceive contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import { computed, onMounted } from "vue";
3
+ import {
4
+ createOpenReceiveVueCheckoutShellBinding,
5
+ defineOpenReceiveElements,
6
+ type CheckoutShellOptions,
7
+ type CheckoutSnapshot
8
+ } from "./index.js";
9
+
10
+ const props = withDefaults(
11
+ defineProps<{
12
+ snapshot: CheckoutSnapshot;
13
+ options?: CheckoutShellOptions;
14
+ }>(),
15
+ {
16
+ options: () => ({})
17
+ }
18
+ );
19
+
20
+ onMounted(() => {
21
+ defineOpenReceiveElements();
22
+ });
23
+
24
+ const shell = computed(() =>
25
+ createOpenReceiveVueCheckoutShellBinding(props.snapshot, props.options)
26
+ );
27
+ </script>
28
+
29
+ <template>
30
+ <section v-bind="shell.rootAttrs">
31
+ <component
32
+ :is="shell.themeToggle.tagName"
33
+ v-bind="shell.themeToggle.attrs"
34
+ />
35
+ <component
36
+ :is="shell.checkout.tagName"
37
+ v-bind="shell.checkout.attrs"
38
+ v-on="shell.checkout.listeners"
39
+ />
40
+ </section>
41
+ </template>
@@ -0,0 +1,39 @@
1
+ import { OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, type CreateCheckoutShellOptions, type CheckoutElementAttributeOptions, type CheckoutElementAttributes, type CheckoutElementEventHandlers, type CheckoutElementListeners, type CheckoutController, type CheckoutControllerOptions, type CheckoutShellElements, type CheckoutShellOptions, type CheckoutSnapshot, type OpenReceiveStoredThemeModelOptions, type OpenReceiveThemeModel, type OpenReceiveThemeModelOptions, type OpenReceiveThemePreference, type OpenReceiveThemeToggleElementAttributeOptions, type OpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
2
+ import { defineOpenReceiveElements, type DefineOpenReceiveElementsOptions } from "@openreceive/elements";
3
+ export { OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS, OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_STORAGE_KEY, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, applyCheckoutThemeAttributes, applyOpenReceiveThemeAttributes, createCheckoutController, createCheckoutElement, createCheckoutElementAttributes, createCheckoutElementListeners, createCheckoutShell, createCheckoutShellModel, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElement, createOpenReceiveThemeToggleElementAttributes, readOpenReceiveThemePreference, syncOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemePreference, writeOpenReceiveThemePreference } from "@openreceive/browser/internal";
4
+ export type { CreateCheckoutElementOptions, CreateCheckoutShellOptions, CreateOpenReceiveThemeToggleElementOptions, CheckoutElementAttributeOptions, CheckoutElementAttributes, CheckoutElementDocument, CheckoutElementEventHandlers, CheckoutElementListeners, CheckoutController, CheckoutControllerOptions, CheckoutShellElements, CheckoutShellCheckoutBinding, CheckoutShellModel, CheckoutShellOptions, CheckoutShellThemeToggleBinding, CheckoutElementTarget, CheckoutSnapshot, OpenReceiveReadThemePreferenceOptions, OpenReceiveStoredThemeModelOptions, OpenReceiveThemeAttributeTarget, OpenReceiveThemeControlTargets, OpenReceiveThemeLabelTarget, OpenReceiveThemeModel, OpenReceiveThemeModelOptions, OpenReceiveThemePreference, OpenReceiveThemeStorageOptions, OpenReceiveThemeToggleElementAttributeOptions, OpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
5
+ export { defineOpenReceiveElements } from "@openreceive/elements";
6
+ export type { DefineOpenReceiveElementsOptions } from "@openreceive/elements";
7
+ export interface OpenReceiveVueCheckoutBindingOptions extends CheckoutElementAttributeOptions, CheckoutElementEventHandlers {
8
+ }
9
+ export interface OpenReceiveVueCheckoutBinding {
10
+ readonly tagName: typeof OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME;
11
+ readonly attrs: CheckoutElementAttributes;
12
+ readonly listeners: CheckoutElementListeners;
13
+ }
14
+ export interface OpenReceiveVueThemeToggleBinding {
15
+ readonly tagName: typeof OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME;
16
+ readonly attrs: OpenReceiveThemeToggleElementAttributes;
17
+ }
18
+ export interface OpenReceiveVueCheckoutShellBinding {
19
+ readonly theme: OpenReceiveThemeModel;
20
+ readonly rootAttrs: OpenReceiveThemeModel["attributes"];
21
+ readonly checkout: OpenReceiveVueCheckoutBinding;
22
+ readonly themeToggle: OpenReceiveVueThemeToggleBinding;
23
+ }
24
+ export interface OpenReceiveVueCheckoutComponentOptions extends CheckoutShellOptions {
25
+ readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
26
+ }
27
+ export interface OpenReceiveVueCheckoutComponentModel extends OpenReceiveVueCheckoutShellBinding {
28
+ readonly componentName: "Checkout";
29
+ readonly defineElements: typeof defineOpenReceiveElements;
30
+ readonly defineElementsOptions?: DefineOpenReceiveElementsOptions;
31
+ }
32
+ export declare function createOpenReceiveVueCheckoutBinding(snapshot: CheckoutSnapshot, options?: OpenReceiveVueCheckoutBindingOptions): OpenReceiveVueCheckoutBinding;
33
+ export declare function createOpenReceiveVueThemeBinding(theme: OpenReceiveThemePreference, options?: OpenReceiveThemeModelOptions): OpenReceiveThemeModel;
34
+ export declare function createOpenReceiveVueStoredThemeBinding(options?: OpenReceiveStoredThemeModelOptions): OpenReceiveThemeModel;
35
+ export declare function createOpenReceiveVueThemeToggleBinding(options?: OpenReceiveThemeToggleElementAttributeOptions): OpenReceiveVueThemeToggleBinding;
36
+ export declare function createOpenReceiveVueCheckoutShellBinding(snapshot: CheckoutSnapshot, options?: CheckoutShellOptions): OpenReceiveVueCheckoutShellBinding;
37
+ export declare function createOpenReceiveVueCheckoutComponentModel(snapshot: CheckoutSnapshot, options?: OpenReceiveVueCheckoutComponentOptions): OpenReceiveVueCheckoutComponentModel;
38
+ export declare function createOpenReceiveVueCheckoutController(options: CheckoutControllerOptions): CheckoutController;
39
+ export declare function createOpenReceiveVueCheckoutShell(snapshot: CheckoutSnapshot, options?: CreateCheckoutShellOptions): CheckoutShellElements;
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import { OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, createCheckoutController, createCheckoutShell, createCheckoutShellModel, createCheckoutElementAttributes, createCheckoutElementListeners, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElementAttributes } from "@openreceive/browser/internal";
2
+ import { defineOpenReceiveElements } from "@openreceive/elements";
3
+ export { OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS, OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME, OPENRECEIVE_THEME_STORAGE_KEY, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME, applyCheckoutThemeAttributes, applyOpenReceiveThemeAttributes, createCheckoutController, createCheckoutElement, createCheckoutElementAttributes, createCheckoutElementListeners, createCheckoutShell, createCheckoutShellModel, createOpenReceiveStoredThemeModel, createOpenReceiveThemeModel, createOpenReceiveThemeToggleElement, createOpenReceiveThemeToggleElementAttributes, readOpenReceiveThemePreference, syncOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemeControls, toggleOpenReceiveStoredThemePreference, writeOpenReceiveThemePreference } from "@openreceive/browser/internal";
4
+ export { defineOpenReceiveElements } from "@openreceive/elements";
5
+ export function createOpenReceiveVueCheckoutBinding(snapshot, options = {}) {
6
+ return {
7
+ tagName: OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME,
8
+ attrs: createCheckoutElementAttributes(snapshot, options),
9
+ listeners: createCheckoutElementListeners(options)
10
+ };
11
+ }
12
+ export function createOpenReceiveVueThemeBinding(theme, options = {}) {
13
+ return createOpenReceiveThemeModel(theme, options);
14
+ }
15
+ export function createOpenReceiveVueStoredThemeBinding(options = {}) {
16
+ return createOpenReceiveStoredThemeModel(options);
17
+ }
18
+ export function createOpenReceiveVueThemeToggleBinding(options = {}) {
19
+ return {
20
+ tagName: OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME,
21
+ attrs: createOpenReceiveThemeToggleElementAttributes(options)
22
+ };
23
+ }
24
+ export function createOpenReceiveVueCheckoutShellBinding(snapshot, options = {}) {
25
+ const shell = createCheckoutShellModel(snapshot, options);
26
+ return {
27
+ theme: shell.theme,
28
+ rootAttrs: shell.rootAttributes,
29
+ checkout: {
30
+ tagName: shell.checkout.tagName,
31
+ attrs: shell.checkout.attributes,
32
+ listeners: shell.checkout.listeners
33
+ },
34
+ themeToggle: {
35
+ tagName: shell.themeToggle.tagName,
36
+ attrs: shell.themeToggle.attributes
37
+ }
38
+ };
39
+ }
40
+ export function createOpenReceiveVueCheckoutComponentModel(snapshot, options = {}) {
41
+ const { defineElementsOptions, ...shellOptions } = options;
42
+ const shell = createOpenReceiveVueCheckoutShellBinding(snapshot, shellOptions);
43
+ return {
44
+ componentName: "Checkout",
45
+ defineElements: defineOpenReceiveElements,
46
+ defineElementsOptions,
47
+ ...shell
48
+ };
49
+ }
50
+ export function createOpenReceiveVueCheckoutController(options) {
51
+ return createCheckoutController(options);
52
+ }
53
+ export function createOpenReceiveVueCheckoutShell(snapshot, options = {}) {
54
+ return createCheckoutShell(snapshot, options);
55
+ }
@@ -0,0 +1 @@
1
+ @import "@openreceive/browser/styles.css";
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@openreceive/vue",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "dependencies": {
6
+ "@openreceive/browser": "0.1.1",
7
+ "@openreceive/elements": "0.1.1"
8
+ },
9
+ "peerDependencies": {
10
+ "vue": ">=3.4.0"
11
+ },
12
+ "peerDependenciesMeta": {
13
+ "vue": {
14
+ "optional": true
15
+ }
16
+ },
17
+ "exports": {
18
+ ".": "./dist/index.js",
19
+ "./checkout.vue": "./dist/Checkout.vue",
20
+ "./styles.css": "./dist/styles.css"
21
+ },
22
+ "types": "./dist/index.d.ts",
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ]
28
+ }