@dropins/storefront-requisition-list 0.0.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.md +188 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/index.d.ts +3 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +10 -0
- package/api.d.ts +1 -0
- package/api.js +4 -0
- package/api.js.map +1 -0
- package/data/models/index.d.ts +2 -0
- package/data/transforms/index.d.ts +2 -0
- package/i18n/en_US.json.d.ts +5 -0
- package/package.json +1 -0
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +4 -0
- package/render.js.map +1 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
|
|
2
|
+
ADOBE DROP-IN TEMPLATE LICENSE AGREEMENT
|
|
3
|
+
Effective Date: first date you use the Drop-in Template
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
The Drop-in Template is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. By downloading, installing, or
|
|
7
|
+
making use of any portion of the Drop-in Template, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below,
|
|
8
|
+
do not use the Drop-in Template. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so.
|
|
9
|
+
If you are not authorized to so bind your employer or such entity, do not use the Drop-in Template.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
AGREED TERMS AND CONDITIONS
|
|
13
|
+
|
|
14
|
+
1. DEFINITIONS.
|
|
15
|
+
|
|
16
|
+
1.1 “Adobe” means collectively, Adobe Inc., a company incorporated in Delaware, U.S.A., having a place of business at 345 Park Avenue, San Jose,
|
|
17
|
+
California USA 95110-2704, U.S.A. (“Adobe US”) and Adobe Systems Software Ireland, company incorporated in Ireland, having a place of business
|
|
18
|
+
4-6 Riverwalk, City West Business Campus, Saggart, Dublin 24, Ireland (“Adobe Ireland”).
|
|
19
|
+
|
|
20
|
+
1.2 “Adobe Product(s)” means software applications, programs and other technologies not included in or with the Drop-in Template which are or may be made generally
|
|
21
|
+
available by Adobe for licensing. This agreement does not govern use of Adobe Products.
|
|
22
|
+
|
|
23
|
+
1.3 “Developer Product(s)” means any software application(s), program(s) and other teconolog(y/ies) you develop with use of the Drop-in Template to function or
|
|
24
|
+
interoperate with Adobe Products.
|
|
25
|
+
|
|
26
|
+
1.4 “Intellectual Property Rights” means copyright, moral rights, trademark, trade dress, patent, trade secret, unfair competition, and any other
|
|
27
|
+
intellectual and proprietary rights.
|
|
28
|
+
|
|
29
|
+
1.5 “Drop-in Template” means all items comprising this drop-in template and all associated materials licensed to you by
|
|
30
|
+
Adobe as part of the Drop-in Template, including all Drop-in Template system files, tools, programs and utilities, as well as any plug-ins or other application programming
|
|
31
|
+
interfaces, header or JAR files (“API”), sample images, sounds, or similar assets (“Content Files”), software code samples, runtimes and libraries,
|
|
32
|
+
including any portion(s) that is modified by you, or merged or incorporated with your Developer Products (“Sample Code”), and any related
|
|
33
|
+
documentation, technical specifications, notes and explanatory materials, as well any modifications, updates, upgrades, or copies of, any of the
|
|
34
|
+
foregoing items, that may be made available by Adobe.
|
|
35
|
+
|
|
36
|
+
2. LICENSES GRANTED TO YOU.
|
|
37
|
+
|
|
38
|
+
2.1 Drop-in Template. Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable license
|
|
39
|
+
to install and use the Drop-in Template solely for your internal design, development and testing of your Developer Products, subject further to the requirements
|
|
40
|
+
and limitations below.
|
|
41
|
+
|
|
42
|
+
2.2 API. Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable license
|
|
43
|
+
to use the API only as provided in or by the applicable specification and to distribute the API solely in, with, and on the same media as, your
|
|
44
|
+
Developer Products. For clarification, you may not modify the API.
|
|
45
|
+
|
|
46
|
+
2.3 Content Files. You may not use, modify, reproduce or distribute any of the Content Files. For the avoidance of doubt, the Content Files are
|
|
47
|
+
included as examples only. You acquire no rights to the Content Files.
|
|
48
|
+
|
|
49
|
+
2.4 Sample Code. Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable
|
|
50
|
+
license to use, modify, merge, and redistribute (in object code form only) all or any portions of the Sample Code solely as part of, and as necessary
|
|
51
|
+
to properly implement, the Drop-in Template in your Developer Products. All and any portion of the Sample code that is modified or merged by you in your Developer
|
|
52
|
+
Products is subject to the terms of this agreement.
|
|
53
|
+
|
|
54
|
+
3. SCOPE OF LICENSE; LIMITATIONS AND RESTRICTIONS
|
|
55
|
+
|
|
56
|
+
3.1 You may not distribute the Drop-in Template or any of its component parts to interoperate with or to run on a platform other than the Adobe-approved platform.
|
|
57
|
+
|
|
58
|
+
3.2 Third-Party Software. The Drop-in Template may contain third-party software, subject to additional terms and conditions; and
|
|
59
|
+
|
|
60
|
+
3.3 You may not modify, port, adapt, creative derivate works, redistribute, or translate any portion of this Drop-in Template; or add or delete any Drop-in Template program
|
|
61
|
+
files that would in any way result in modifying the functionality or appearance of any element of the Adobe Products.
|
|
62
|
+
|
|
63
|
+
3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in Template, except and
|
|
64
|
+
only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile Drop-in Template in order to obtain information
|
|
65
|
+
necessary to render the Drop-in Template interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe
|
|
66
|
+
may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in Template
|
|
67
|
+
software to ensure that Adobe’s and its licensors’ Intellectual Proprietary Rights in the Drop-in Template are protected.
|
|
68
|
+
|
|
69
|
+
3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the
|
|
70
|
+
Drop-in Template, or any of your rights in the Drop-in Template, nor authorize any portion of the Drop-in Template to be copied onto another’s device, computer or platform, including on a
|
|
71
|
+
service bureau basis to other providers (i.e., volume printing, banking, payroll service providers, etc) who provide you free or fee-based business
|
|
72
|
+
services.
|
|
73
|
+
|
|
74
|
+
4. VIRAL OPEN SOURCE SOFTWARE AND SERVICES
|
|
75
|
+
|
|
76
|
+
You are not license to (and you agree that you will not) merge, integrate or use the Drop-in Template with any Viral Open Source Software or Viral Service, or
|
|
77
|
+
otherwise take any action that could require disclosure, distribution, or licensing of all or any part of the Drop-in Template in source code form for any purpose
|
|
78
|
+
whatsoever. For purposes of this Section, “Viral Open Source Software” means software licensed under the GNU General Public License, the GNU Affero
|
|
79
|
+
General Public License (AGPL), the GNU Lesser General Public License (LGPL), or any other license terms that would require, or condition your use,
|
|
80
|
+
modification, or distribution of such licensed software on the disclosure, distribution, or licensing of any other software in source code form, for
|
|
81
|
+
the purpose of making derivative works, or at no charge, and “Viral Service” means any service that contains any viruses, Trojan horses, worms, time
|
|
82
|
+
bombs, cancelbots or other computer programming routines that are intended to damage, detrimentally interfere with, surreptitiously intercept,
|
|
83
|
+
expropriate or deprive owners’ possession of any system, data or personal information, or that in any way violates any law, statute, ordinance,
|
|
84
|
+
regulation or rights (including any law, regulations or rights respecting intellectual property, computer spyware, privacy, export control, unfair
|
|
85
|
+
competition, antidiscrimination or false advertising), or otherwise interferes with the operability of Adobe Products or third-party programs or
|
|
86
|
+
software.
|
|
87
|
+
|
|
88
|
+
5. NON-BLOCKING OF ADOBE DEVELOPMENT
|
|
89
|
+
|
|
90
|
+
You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or
|
|
91
|
+
functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement
|
|
92
|
+
will impair, limit or curtail Adobe’s right to continue with its development, maintenance or distribution of Adobe Products. You agree that you will
|
|
93
|
+
not assert in any way any patent owned by you arising out of or in connection with your use of the Drop-in Template, or any Drop-in Template modifications made by you, against
|
|
94
|
+
Adobe, its customers, subsidiaries or affiliates, or any of their customers, direct or indirect, agents and contractors for the manufacture, use,
|
|
95
|
+
import, license, offer for sale, or sale of any Adobe Products.
|
|
96
|
+
|
|
97
|
+
6. OWNERSHIP; INTELLECTUAL PROPERTY RIGHTS
|
|
98
|
+
|
|
99
|
+
6.1 The items contained in the Drop-in Template are the Intellectual Property of Adobe and its licensors and are protected by United States copyright and patent
|
|
100
|
+
law, international treaty provisions and applicable laws of the country in which it is being used. Adobe and its licensors reserve all rights not
|
|
101
|
+
expressly granted to you under this agreement, and retain all right, title, and interest in the Drop-in Template, including all Intellectual Property Rights.
|
|
102
|
+
|
|
103
|
+
6.2 The Drop-in Template, or any of its component parts, may be supplied to you with certain accompanying proprietary notices, including patent, copyright and
|
|
104
|
+
trademark notices. You agree to protect all copyright and other ownership interests of Adobe and its licensors in the Drop-in Template supplied to you under this
|
|
105
|
+
agreement; to preserve exactly (and not remove or alter) all proprietary notices displayed in or on the Drop-in Template; to reproduce the same proprietary
|
|
106
|
+
notices in all copies you make of any portion of the Drop-in Template.
|
|
107
|
+
|
|
108
|
+
6.3 You agree to include in your Developer Products Adobe’s copyright notices, wherever such notices are customarily posted, in substantially the
|
|
109
|
+
following form: Portions of software used to develop this product copyrighted by Adobe and its licensors. All Rights Reserved.
|
|
110
|
+
|
|
111
|
+
6.4 Nothing in this agreement gives you a right to use the name, logo or trademarks of Adobe or its licensors to market your Developer Products.
|
|
112
|
+
|
|
113
|
+
7. CONFIDENTIAL INFORMATION
|
|
114
|
+
|
|
115
|
+
With respect to the API, and any portion, included in the Drop-in Template (for purposes of this Section, “Adobe Confidential Information”), you will treat the
|
|
116
|
+
Adobe Confidential Information, and exercise the same degree of care to protect it, as you afford to your own confidential information. Your
|
|
117
|
+
obligations under this Section will terminate when you can document that (a) the Adobe Confidential Information was in the public domain at or
|
|
118
|
+
subsequent to the time Adobe communicated or provided it to you with no fault of your own; (b) your employees or agents developed independently
|
|
119
|
+
without reference to any Adobe Confidential Information Adobe communicated or provided to you; or (c) your communication of Adobe Confidential
|
|
120
|
+
Information was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the
|
|
121
|
+
rights of a party under this agreement.
|
|
122
|
+
|
|
123
|
+
8. TERM; TERMINATION
|
|
124
|
+
|
|
125
|
+
This agreement will commence on the Effective Date and will continue unless terminated. Adobe may terminate this agreement immediately upon notice
|
|
126
|
+
to you, and without judicial intervention, if you fail to comply with any term of its terms. You may terminate this agreement at any time by
|
|
127
|
+
discontinuing all your use(s) of the Drop-in Template and you agree to destroying or removing all full and partial copies of the Drop-in Template from your computer. If
|
|
128
|
+
requested by Adobe, you must demonstrate proof of your compliance with the terms of this Section. In the event of termination, the terms of this
|
|
129
|
+
agreement that, by their nature, are meant to survive termination, including all terms relating to viral open source software and services,
|
|
130
|
+
ownership, confidential information, indemnity obligations and procedures, disclaimers of warranty, limitations on and exclusions of remedies and
|
|
131
|
+
damages, dispute resolution, and waiver, will survive termination of this agreement.
|
|
132
|
+
|
|
133
|
+
9. DISCLAIMER OF WARRANTY; LIMITATION OF LIABILITY
|
|
134
|
+
|
|
135
|
+
You expressly understand and agree that, to the maximum extent permitted by applicable law:
|
|
136
|
+
|
|
137
|
+
9.1 Use OF THE Drop-in Template is entirely at your own risk. The Drop-in Template is provided by Adobe “AS-IS” and with all faults. Adobe and its licensors are not liable to
|
|
138
|
+
you or anyone else for any special, incidental, indirect, consequential, or punitive damages whatsoever (even if Adobe has been advised of the
|
|
139
|
+
possibility of such damages), including (a) damages resulting from loss of use, data, or profits, whether or not foreseeable, (b) damages based on
|
|
140
|
+
any theory of liability, including breach of contract or warranty, negligence or other tortious action, or (c) damages arising from any other claim
|
|
141
|
+
arising out of or in connection with your use of the Drop-in Template.
|
|
142
|
+
|
|
143
|
+
9.2 Adobe’s total liability in any matter arising out of or related to these terms is limited to US $100 or the aggregate amount that you paid for
|
|
144
|
+
use of the Drop-in Template during the 12 months prior to the event giving rise to the damages, whichever is larger. This limitation will apply even if Adobe has
|
|
145
|
+
been advised of the possibility of such damages and regardless of any failure of the essential purpose of any limited remedy.
|
|
146
|
+
|
|
147
|
+
10. INDEMNIFICATION
|
|
148
|
+
|
|
149
|
+
To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors,
|
|
150
|
+
or suppliers from any claim or demand, including reasonable attorneys’ fees, that arise from the use and distribution of your Developer Products that
|
|
151
|
+
contain or are based upon any portion of the Drop-in Template, or from your violation of the terms of this agreement.
|
|
152
|
+
|
|
153
|
+
11. DISPUTE RESOLUTION
|
|
154
|
+
|
|
155
|
+
11.1 Choice of Law. If you are a resident of North America (or if your organization is headquartered in North America), your relationship is with
|
|
156
|
+
Adobe Inc., a Delaware corporation, and the Drop-in Template is governed by the laws of California. If you reside outside of North America, your relationship is
|
|
157
|
+
with Adobe Systems Software Ireland Limited, and the Drop-in Template is governed by the laws of Ireland.
|
|
158
|
+
|
|
159
|
+
11.2 Venue. You agree that any claim or dispute you may have against Adobe must be resolved by a court located in Santa Clara County, California
|
|
160
|
+
when the laws of California apply, or Dublin, Ireland, when the laws of Ireland apply . You agree to submit to the personal jurisdiction of the
|
|
161
|
+
courts located in Santa Clara County, California, United States of America when the laws of California apply, and the courts of Dublin, Ireland, when
|
|
162
|
+
the laws of Ireland applies, for the purpose of litigating such claims or disputes. The parties specifically disclaim the U.N. Convention on
|
|
163
|
+
Contracts for the International Sale of Goods.
|
|
164
|
+
|
|
165
|
+
11.3 Injunctive Relief. Notwithstanding the foregoing, in the event of your or others’ unauthorized access to or use of the Drop-in Template in violation of
|
|
166
|
+
this Agreement, you agree that Adobe is entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
|
167
|
+
|
|
168
|
+
12. EXPORT RULES
|
|
169
|
+
|
|
170
|
+
The Drop-in Template and your use of the Drop-in Template are subject to U.S. and international laws, restrictions, and regulations that may govern the import, export, and use
|
|
171
|
+
of the Drop-in Template. You agree to comply with all such laws, restrictions, and regulations.
|
|
172
|
+
|
|
173
|
+
13. NOTICE TO U.S. GOVERNMENT END USERS
|
|
174
|
+
|
|
175
|
+
For U.S. Government procurements, the Drop-in Template is a commercial computer software as defined in FAR 12.212 and subject to restricted rights as defined in
|
|
176
|
+
FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights" and DFARS 227.7202, “Rights in Commercial Computer Software or Commercial
|
|
177
|
+
Computer Software Documentation”, as applicable, and any successor regulations. Any use, modification, reproduction release, performance, display or
|
|
178
|
+
disclosure of the Drop-in Template by the U.S. Government shall be solely in accordance with license rights and restrictions described herein.
|
|
179
|
+
|
|
180
|
+
14. GENERAL PROVISIONS
|
|
181
|
+
|
|
182
|
+
14.1 Severability. If it turns out that a particular term is not enforceable, the unenforceability of that term will not affect any other terms.
|
|
183
|
+
|
|
184
|
+
14.2 Modification; Waiver. No provision of this agreement will be deemed to have been modified or waived by any act or acquiescence on the part of
|
|
185
|
+
Adobe, its agents, or employees, but only by any instrument in writing, signed by an authorized officer of Adobe.
|
|
186
|
+
|
|
187
|
+
14.3 Entire Agreement. This Agreement is the entire agreement, superseding any prior written or oral agreements, between you and Adobe relating to
|
|
188
|
+
the Drop-in Template.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe-commerce/fetch-graphql').Header | ((prev: import('@adobe-commerce/fetch-graphql').Header) => import('@adobe-commerce/fetch-graphql').Header)) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe-commerce/fetch-graphql').FetchOptions | undefined) => Promise<{
|
|
2
|
+
errors?: import('@adobe-commerce/fetch-graphql').FetchQueryError | undefined;
|
|
3
|
+
data: T;
|
|
4
|
+
}>, getConfig: () => {
|
|
5
|
+
endpoint: string | undefined;
|
|
6
|
+
fetchGraphQlHeaders: import('@adobe-commerce/fetch-graphql').Header;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=fetch-graphql.d.ts.map
|
package/api/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Initializer } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
+
import { Lang } from '@dropins/tools/types/elsie/src/i18n';
|
|
3
|
+
|
|
4
|
+
type ConfigProps = {
|
|
5
|
+
langDefinitions?: Lang;
|
|
6
|
+
};
|
|
7
|
+
export declare const initialize: Initializer<ConfigProps>;
|
|
8
|
+
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=initialize.d.ts.map
|
package/api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api/index'
|
package/api.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{Initializer as n}from"@dropins/tools/lib.js";import{FetchGraphQL as o}from"@dropins/tools/fetch-graphql.js";const e=new n({init:async t=>{const i={};e.config.setConfig({...i,...t})},listeners:()=>[]}),s=e.config,{setEndpoint:a,setFetchGraphQlHeader:h,removeFetchGraphQlHeader:f,setFetchGraphQlHeaders:p,fetchGraphQl:g,getConfig:l}=new o().getMethods();export{s as config,g as fetchGraphQl,l as getConfig,e as initialize,f as removeFetchGraphQlHeader,a as setEndpoint,h as setFetchGraphQlHeader,p as setFetchGraphQlHeaders};
|
|
4
|
+
//# sourceMappingURL=api.js.map
|
package/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts","/@dropins/storefront-requisition-list/src/api/fetch-graphql/fetch-graphql.ts"],"sourcesContent":["import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\n// import { events } from '@adobe-commerce/event-bus';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n // events.on('authenticated', (authenticated) => {\n // console.log('authenticated', authenticated);\n // }),\n ],\n});\n\nexport const config = initialize.config;\n","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n"],"names":["initialize","Initializer","config","defaultConfig","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL"],"mappings":"mHAQO,MAAMA,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CACtB,MAAMC,EAAgB,CAAA,EAEtBH,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe,GAAGD,EAAQ,CAC7D,EAEA,UAAW,IAAM,CAAA,CAKnB,CAAC,EAEYA,EAASF,EAAW,OCpBpB,CACX,YAAAI,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "@dropins/storefront-requisition-list", "version": "0.0.1", "@dropins/tools": "^1.4.0-beta2", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './render/index'
|
package/render.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{Render as f}from"@dropins/tools/lib.js";import{useState as i,useEffect as m}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as a}from"@dropins/tools/event-bus.js";const p={"":{}},u={default:p},d=({children:o})=>{const[t,n]=i("en_US");return m(()=>{const r=a.on("locale",s=>{n(s)},{eager:!0});return()=>{r==null||r.off()}},[]),e(c,{lang:t,langDefinitions:u,children:o})},x=new f(e(d,{}));export{x as render};
|
|
4
|
+
//# sourceMappingURL=render.js.map
|
package/render.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sources":["/@dropins/storefront-requisition-list/src/render/Provider.tsx","/@dropins/storefront-requisition-list/src/render/render.tsx"],"sourcesContent":["import { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n return (\n <UIProvider lang={lang} langDefinitions={langDefinitions}>\n {children}\n </UIProvider>\n );\n};\n","import { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","jsx","UIProvider","render","Render"],"mappings":"kTASMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9C,OAAAC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,EAAA,CAAK,EAEhB,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,CAAA,CAAE,EAGHG,EAACC,EAAA,CAAW,KAAAR,EAAY,gBAAAJ,EACrB,SAAAG,CAAA,CACH,CAEJ,ECtCaU,EAAS,IAAIC,EAAOH,EAACT,IAAS,CAAE"}
|