@payloadcms/plugin-ecommerce 4.0.0-internal.4cbdd50 → 4.0.0-internal.543da65

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/PriceInput/FormattedInput.tsx"],"sourcesContent":["'use client'\n\nimport type { StaticDescription, StaticLabel } from 'payload'\n\nimport { FieldDescription, FieldLabel, useField, useFormFields } from '@payloadcms/ui'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { Currency } from '../../types/index.js'\n\nimport { USD } from '../../currencies/index.js'\nimport { convertFromBaseValue, convertToBaseValue } from '../utilities.js'\n\ninterface Props {\n currency?: Currency\n description?: StaticDescription\n disabled?: boolean\n error?: string\n id?: string\n label?: StaticLabel\n path: string\n placeholder?: string\n readOnly?: boolean\n required?: boolean\n supportedCurrencies: Currency[]\n}\n\nconst baseClass = 'formattedPrice'\n\nexport const FormattedInput: React.FC<Props> = ({\n id: idFromProps,\n currency: currencyFromProps,\n description,\n disabled = false,\n label,\n path,\n placeholder = '0.00',\n readOnly,\n required,\n supportedCurrencies,\n}) => {\n const { setValue, value } = useField<number>({ path })\n const [displayValue, setDisplayValue] = useState<string>('')\n\n const inputRef = useRef<HTMLInputElement>(null)\n const isFirstRender = useRef(true)\n const debounceTimer = useRef<NodeJS.Timeout | null>(null)\n\n const parentPath = path.split('.').slice(0, -1).join('.')\n const currencyPath = parentPath ? `${parentPath}.currency` : 'currency'\n\n const currencyFromSelectField = useFormFields(([fields, _]) => fields[currencyPath])\n\n const currencyCode = currencyFromProps?.code ?? (currencyFromSelectField?.value as string)\n const id = idFromProps || path\n\n const currency = useMemo<Currency>(() => {\n if (currencyCode && supportedCurrencies) {\n const foundCurrency = supportedCurrencies.find(\n (supportedCurrency) => supportedCurrency.code === currencyCode,\n )\n\n return foundCurrency ?? supportedCurrencies[0] ?? USD\n }\n\n return supportedCurrencies[0] ?? USD\n }, [currencyCode, supportedCurrencies])\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n\n if (value === undefined || value === null) {\n setDisplayValue('')\n } else {\n setDisplayValue(convertFromBaseValue({ baseValue: value, currency }))\n }\n }\n }, [currency, value, currencyFromProps])\n\n const updateValue = useCallback(\n (inputValue: string) => {\n if (inputValue === '') {\n setValue(null)\n\n return\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue: inputValue })\n\n setValue(baseValue)\n },\n [currency, setValue],\n )\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value\n\n if (!/^\\d*(?:\\.\\d*)?$/.test(inputValue) && inputValue !== '') {\n return\n }\n\n setDisplayValue(inputValue)\n\n // Clear any existing timer\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n }\n\n // Only update the base value after a delay to avoid formatting while typing\n debounceTimer.current = setTimeout(() => {\n updateValue(inputValue)\n }, 500)\n },\n [updateValue, setDisplayValue],\n )\n\n const handleInputBlur = useCallback(() => {\n if (displayValue === '') {\n return\n }\n\n // Clear any pending debounce\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n debounceTimer.current = null\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue })\n const formattedValue = convertFromBaseValue({ baseValue, currency })\n\n if (value != baseValue) {\n setValue(baseValue)\n }\n\n setDisplayValue(formattedValue)\n }, [currency, displayValue, setValue, value])\n\n return (\n <div className={`field-type number ${baseClass}`}>\n {label && <FieldLabel as=\"label\" htmlFor={id} label={label} required={required} />}\n\n <div className={`${baseClass}Container`}>\n <div className={`${baseClass}CurrencySymbol`}>\n <span>{currency.symbol}</span>\n </div>\n\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n className={`${baseClass}Input`}\n disabled={disabled || readOnly}\n id={id}\n onBlur={handleInputBlur}\n onChange={handleInputChange}\n placeholder={placeholder}\n ref={inputRef}\n type=\"text\"\n value={displayValue}\n />\n </div>\n <FieldDescription\n className={`${baseClass}Description`}\n description={description}\n path={path}\n />\n </div>\n )\n}\n"],"names":["FieldDescription","FieldLabel","useField","useFormFields","useCallback","useEffect","useMemo","useRef","useState","USD","convertFromBaseValue","convertToBaseValue","baseClass","FormattedInput","id","idFromProps","currency","currencyFromProps","description","disabled","label","path","placeholder","readOnly","required","supportedCurrencies","setValue","value","displayValue","setDisplayValue","inputRef","isFirstRender","debounceTimer","parentPath","split","slice","join","currencyPath","currencyFromSelectField","fields","_","currencyCode","code","foundCurrency","find","supportedCurrency","current","undefined","baseValue","updateValue","inputValue","handleInputChange","e","target","test","clearTimeout","setTimeout","handleInputBlur","formattedValue","div","className","as","htmlFor","span","symbol","input","onBlur","onChange","ref","type"],"mappings":"AAAA;;AAIA,SAASA,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,iBAAgB;AACtF,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAIzE,SAASC,GAAG,QAAQ,4BAA2B;AAC/C,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,kBAAiB;AAgB1E,MAAMC,YAAY;AAElB,OAAO,MAAMC,iBAAkC,CAAC,EAC9CC,IAAIC,WAAW,EACfC,UAAUC,iBAAiB,EAC3BC,WAAW,EACXC,WAAW,KAAK,EAChBC,KAAK,EACLC,IAAI,EACJC,cAAc,MAAM,EACpBC,QAAQ,EACRC,QAAQ,EACRC,mBAAmB,EACpB;IACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGzB,SAAiB;QAAEmB;IAAK;IACpD,MAAM,CAACO,cAAcC,gBAAgB,GAAGrB,SAAiB;IAEzD,MAAMsB,WAAWvB,OAAyB;IAC1C,MAAMwB,gBAAgBxB,OAAO;IAC7B,MAAMyB,gBAAgBzB,OAA8B;IAEpD,MAAM0B,aAAaZ,KAAKa,KAAK,CAAC,KAAKC,KAAK,CAAC,GAAG,CAAC,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QAEA,4EAA4E;QAC5Ed,cAAcc,OAAO,GAAGU,WAAW;YACjCP,YAAYC;QACd,GAAG;IACL,GACA;QAACD;QAAapB;KAAgB;IAGhC,MAAM4B,kBAAkBrD,YAAY;QAClC,IAAIwB,iBAAiB,IAAI;YACvB;QACF;QAEA,6BAA6B;QAC7B,IAAII,cAAcc,OAAO,EAAE;YACzBS,aAAavB,cAAcc,OAAO;YAClCd,cAAcc,OAAO,GAAG;QAC1B;QAEA,MAAME,YAAYrC,mBAAmB;YAAEK;YAAUY;QAAa;QAC9D,MAAM8B,iBAAiBhD,qBAAqB;YAAEsC;YAAWhC;QAAS;QAElE,IAAIW,SAASqB,WAAW;YACtBtB,SAASsB;QACX;QAEAnB,gBAAgB6B;IAClB,GAAG;QAAC1C;QAAUY;QAAcF;QAAUC;KAAM;IAE5C,qBACE,MAACgC;QAAIC,WAAW,CAAC,kBAAkB,EAAEhD,WAAW;;YAC7CQ,uBAAS,KAACnB;gBAAW4D,IAAG;gBAAQC,SAAShD;gBAAIM,OAAOA;gBAAOI,UAAUA;;0BAEtE,MAACmC;gBAAIC,WAAW,GAAGhD,UAAU,SAAS,CAAC;;kCACrC,KAAC+C;wBAAIC,WAAW,GAAGhD,UAAU,cAAc,CAAC;kCAC1C,cAAA,KAACmD;sCAAM/C,SAASgD,MAAM;;;kCAIxB,KAACC;wBACCL,WAAW,GAAGhD,UAAU,KAAK,CAAC;wBAC9BO,UAAUA,YAAYI;wBACtBT,IAAIA;wBACJoD,QAAQT;wBACRU,UAAUhB;wBACV7B,aAAaA;wBACb8C,KAAKtC;wBACLuC,MAAK;wBACL1C,OAAOC;;;;0BAGX,KAAC5B;gBACC4D,WAAW,GAAGhD,UAAU,WAAW,CAAC;gBACpCM,aAAaA;gBACbG,MAAMA;;;;AAId,EAAC"}
1
+ {"version":3,"sources":["../../../src/ui/PriceInput/FormattedInput.tsx"],"sourcesContent":["'use client'\n\nimport type { StaticDescription, StaticLabel } from 'payload'\n\nimport { FieldDescription, FieldLabel, useField, useFormFields } from '@payloadcms/ui'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { Currency } from '../../types/index.js'\n\nimport { USD } from '../../currencies/index.js'\nimport { convertFromBaseValue, convertToBaseValue } from '../utilities.js'\n\ninterface Props {\n currency?: Currency\n description?: StaticDescription\n disabled?: boolean\n error?: string\n id?: string\n label?: StaticLabel\n path: string\n placeholder?: string\n readOnly?: boolean\n required?: boolean\n supportedCurrencies: Currency[]\n}\n\nconst baseClass = 'formattedPrice'\n\nexport const FormattedInput: React.FC<Props> = ({\n id: idFromProps,\n currency: currencyFromProps,\n description,\n disabled = false,\n label,\n path,\n placeholder = '0.00',\n readOnly,\n required,\n supportedCurrencies,\n}) => {\n const { setValue, value } = useField<number>({ path })\n const [displayValue, setDisplayValue] = useState<string>('')\n\n const inputRef = useRef<HTMLInputElement>(null)\n const isFirstRender = useRef(true)\n const debounceTimer = useRef<NodeJS.Timeout | null>(null)\n\n const parentPath = path.split('.').slice(0, -1).join('.')\n const currencyPath = parentPath ? `${parentPath}.currency` : 'currency'\n\n const currencyFromSelectField = useFormFields(([fields, _]) => fields[currencyPath])\n\n const currencyCode = currencyFromProps?.code ?? (currencyFromSelectField?.value as string)\n const id = idFromProps || path\n\n const currency = useMemo<Currency>(() => {\n if (currencyCode && supportedCurrencies) {\n const foundCurrency = supportedCurrencies.find(\n (supportedCurrency) => supportedCurrency.code === currencyCode,\n )\n\n return foundCurrency ?? supportedCurrencies[0] ?? USD\n }\n\n return supportedCurrencies[0] ?? USD\n }, [currencyCode, supportedCurrencies])\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n\n if (value === undefined || value === null) {\n setDisplayValue('')\n } else {\n setDisplayValue(convertFromBaseValue({ baseValue: value, currency }))\n }\n }\n }, [currency, value, currencyFromProps])\n\n const updateValue = useCallback(\n (inputValue: string) => {\n if (inputValue === '') {\n setValue(null)\n\n return\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue: inputValue })\n\n setValue(baseValue)\n },\n [currency, setValue],\n )\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value\n\n if (!/^\\d*(?:\\.\\d*)?$/.test(inputValue) && inputValue !== '') {\n return\n }\n\n setDisplayValue(inputValue)\n\n // Clear any existing timer\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n }\n\n // Only update the base value after a delay to avoid formatting while typing\n debounceTimer.current = setTimeout(() => {\n updateValue(inputValue)\n }, 500)\n },\n [updateValue, setDisplayValue],\n )\n\n const handleInputBlur = useCallback(() => {\n if (displayValue === '') {\n return\n }\n\n // Clear any pending debounce\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n debounceTimer.current = null\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue })\n const formattedValue = convertFromBaseValue({ baseValue, currency })\n\n if (value != baseValue) {\n setValue(baseValue)\n }\n\n setDisplayValue(formattedValue)\n }, [currency, displayValue, setValue, value])\n\n return (\n <div className={`field-type number ${baseClass}`}>\n {label && <FieldLabel as=\"label\" htmlFor={id} label={label} required={required} />}\n\n <div className={`${baseClass}Container form-input-group`}>\n <div className={`${baseClass}CurrencySymbol`}>\n <span>{currency.symbol}</span>\n </div>\n\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n className={`${baseClass}Input form-input`}\n disabled={disabled || readOnly}\n id={id}\n onBlur={handleInputBlur}\n onChange={handleInputChange}\n placeholder={placeholder}\n ref={inputRef}\n type=\"text\"\n value={displayValue}\n />\n </div>\n <FieldDescription\n className={`${baseClass}Description`}\n description={description}\n path={path}\n />\n </div>\n )\n}\n"],"names":["FieldDescription","FieldLabel","useField","useFormFields","useCallback","useEffect","useMemo","useRef","useState","USD","convertFromBaseValue","convertToBaseValue","baseClass","FormattedInput","id","idFromProps","currency","currencyFromProps","description","disabled","label","path","placeholder","readOnly","required","supportedCurrencies","setValue","value","displayValue","setDisplayValue","inputRef","isFirstRender","debounceTimer","parentPath","split","slice","join","currencyPath","currencyFromSelectField","fields","_","currencyCode","code","foundCurrency","find","supportedCurrency","current","undefined","baseValue","updateValue","inputValue","handleInputChange","e","target","test","clearTimeout","setTimeout","handleInputBlur","formattedValue","div","className","as","htmlFor","span","symbol","input","onBlur","onChange","ref","type"],"mappings":"AAAA;;AAIA,SAASA,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,iBAAgB;AACtF,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAIzE,SAASC,GAAG,QAAQ,4BAA2B;AAC/C,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,kBAAiB;AAgB1E,MAAMC,YAAY;AAElB,OAAO,MAAMC,iBAAkC,CAAC,EAC9CC,IAAIC,WAAW,EACfC,UAAUC,iBAAiB,EAC3BC,WAAW,EACXC,WAAW,KAAK,EAChBC,KAAK,EACLC,IAAI,EACJC,cAAc,MAAM,EACpBC,QAAQ,EACRC,QAAQ,EACRC,mBAAmB,EACpB;IACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGzB,SAAiB;QAAEmB;IAAK;IACpD,MAAM,CAACO,cAAcC,gBAAgB,GAAGrB,SAAiB;IAEzD,MAAMsB,WAAWvB,OAAyB;IAC1C,MAAMwB,gBAAgBxB,OAAO;IAC7B,MAAMyB,gBAAgBzB,OAA8B;IAEpD,MAAM0B,aAAaZ,KAAKa,KAAK,CAAC,KAAKC,KAAK,CAAC,GAAG,CAAC,GAAGC,IAAI,CAAC;IACrD,MAAMC,eAAeJ,aAAa,GAAGA,WAAW,SAAS,CAAC,GAAG;IAE7D,MAAMK,0BAA0BnC,cAAc,CAAC,CAACoC,QAAQC,EAAE,GAAKD,MAAM,CAACF,aAAa;IAEnF,MAAMI,eAAexB,mBAAmByB,QAASJ,yBAAyBX;IAC1E,MAAMb,KAAKC,eAAeM;IAE1B,MAAML,WAAWV,QA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AAcc,OAAO,GAAG;QAC1B;QAEA,MAAME,YAAYrC,mBAAmB;YAAEK;YAAUY;QAAa;QAC9D,MAAM8B,iBAAiBhD,qBAAqB;YAAEsC;YAAWhC;QAAS;QAElE,IAAIW,SAASqB,WAAW;YACtBtB,SAASsB;QACX;QAEAnB,gBAAgB6B;IAClB,GAAG;QAAC1C;QAAUY;QAAcF;QAAUC;KAAM;IAE5C,qBACE,MAACgC;QAAIC,WAAW,CAAC,kBAAkB,EAAEhD,WAAW;;YAC7CQ,uBAAS,KAACnB;gBAAW4D,IAAG;gBAAQC,SAAShD;gBAAIM,OAAOA;gBAAOI,UAAUA;;0BAEtE,MAACmC;gBAAIC,WAAW,GAAGhD,UAAU,0BAA0B,CAAC;;kCACtD,KAAC+C;wBAAIC,WAAW,GAAGhD,UAAU,cAAc,CAAC;kCAC1C,cAAA,KAACmD;sCAAM/C,SAASgD,MAAM;;;kCAIxB,KAACC;wBACCL,WAAW,GAAGhD,UAAU,gBAAgB,CAAC;wBACzCO,UAAUA,YAAYI;wBACtBT,IAAIA;wBACJoD,QAAQT;wBACRU,UAAUhB;wBACV7B,aAAaA;wBACb8C,KAAKtC;wBACLuC,MAAK;wBACL1C,OAAOC;;;;0BAGX,KAAC5B;gBACC4D,WAAW,GAAGhD,UAAU,WAAW,CAAC;gBACpCM,aAAaA;gBACbG,MAAMA;;;;AAId,EAAC"}
@@ -1,35 +1,23 @@
1
- .formattedPrice {
2
- .formattedPriceLabel {
3
- display: block;
4
- margin-bottom: 0.5rem;
5
- font-size: 0.875rem;
6
- font-weight: 500;
7
- color: #333;
8
- }
9
-
10
- .formattedPriceContainer {
11
- display: flex;
12
- position: relative;
13
- }
1
+ @layer payload-default {
2
+ .formattedPrice {
3
+ .formattedPriceCurrencySymbol {
4
+ position: absolute;
5
+ inset-inline-start: var(--field-padding-inline);
6
+ top: 50%;
7
+ transform: translateY(-50%);
8
+ color: var(--color-text-secondary);
9
+ user-select: none;
10
+ pointer-events: none;
11
+ z-index: 1;
12
+ }
14
13
 
15
- .formattedPriceCurrencySymbol {
16
- position: absolute;
17
- left: 10px;
18
- top: 50%;
19
- transform: translateY(calc(-50%));
20
- color: var(--theme-elevation-500);
21
- user-select: none;
22
- pointer-events: none;
23
- }
24
-
25
- .formattedPriceInput {
26
- padding: 0.5rem 0.5rem 0.5rem 1.75rem;
27
- min-width: 2rem;
28
- width: fit-content;
29
- max-width: 10rem;
30
- }
14
+ .formattedPriceInput {
15
+ /* Reserve space for the absolutely-positioned currency symbol prefix */
16
+ padding-inline-start: var(--spacer-4);
17
+ }
31
18
 
32
- .formattedPriceDescription {
33
- max-width: 46rem;
19
+ .formattedPriceDescription {
20
+ max-width: 75ch;
21
+ }
34
22
  }
35
23
  }
@@ -2,12 +2,12 @@
2
2
  .priceRowLabel {
3
3
  display: flex;
4
4
  align-items: center;
5
- gap: calc(var(--base) * 1);
5
+ gap: var(--spacer-3);
6
6
  }
7
7
 
8
8
  .priceValue {
9
9
  display: flex;
10
10
  align-items: center;
11
- gap: calc(var(--base) * 0.25);
11
+ gap: var(--spacer-1);
12
12
  }
13
13
  }
@@ -1,26 +1,24 @@
1
1
  @layer payload-default {
2
2
  .variantOptionsSelector {
3
- margin-top: calc(var(--spacing-field) * 2);
4
- margin-bottom: calc(var(--spacing-field) * 2);
3
+ margin-block: var(--spacer-2);
5
4
  }
6
5
 
7
6
  .variantOptionsSelectorHeading {
8
- font-size: calc(var(--base) * 1);
9
- font-weight: 500;
7
+ font-size: var(--text-body-large-font-size);
10
8
  color: var(--color-text);
11
- margin-bottom: calc(var(--base) * 0.5);
9
+ margin-block-end: var(--spacer-2);
12
10
  }
13
11
 
14
12
  .variantOptionsSelectorItem {
15
13
  display: flex;
16
14
  flex-direction: column;
17
- gap: 0;
15
+ gap: var(--spacer-2);
18
16
  }
19
17
 
20
18
  .variantOptionsSelectorList {
21
19
  display: flex;
22
20
  flex-direction: column;
23
- gap: calc(var(--base) * 0.75);
21
+ gap: var(--spacer-3);
24
22
  }
25
23
 
26
24
  .variantOptionsSelectorError {
@@ -29,9 +27,9 @@
29
27
 
30
28
  .variantOptionsSelectorErrorWrapper {
31
29
  &.showError {
32
- border-radius: 2px;
33
- outline: 1px solid var(--theme-error-400);
34
- outline-offset: 2px;
30
+ border-radius: var(--radius-small);
31
+ outline: var(--stroke-width-small) solid var(--field-color-border-error);
32
+ outline-offset: var(--stroke-width-medium);
35
33
  }
36
34
  }
37
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-ecommerce",
3
- "version": "4.0.0-internal.4cbdd50",
3
+ "version": "4.0.0-internal.543da65",
4
4
  "description": "Ecommerce plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "dependencies": {
76
76
  "qs-esm": "8.0.1",
77
- "@payloadcms/translations": "4.0.0-internal.4cbdd50",
78
- "@payloadcms/ui": "4.0.0-internal.4cbdd50"
77
+ "@payloadcms/translations": "4.0.0-internal.543da65",
78
+ "@payloadcms/ui": "4.0.0-internal.543da65"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/json-schema": "7.0.15",
@@ -83,14 +83,14 @@
83
83
  "@types/react-dom": "19.2.3",
84
84
  "stripe": "18.3.0",
85
85
  "@payloadcms/eslint-config": "3.28.0",
86
- "@payloadcms/next": "4.0.0-internal.4cbdd50",
87
- "@payloadcms/translations": "4.0.0-internal.4cbdd50",
88
- "payload": "4.0.0-internal.4cbdd50"
86
+ "@payloadcms/next": "4.0.0-internal.543da65",
87
+ "@payloadcms/translations": "4.0.0-internal.543da65",
88
+ "payload": "4.0.0-internal.543da65"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
92
92
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
93
- "payload": "4.0.0-internal.4cbdd50"
93
+ "payload": "4.0.0-internal.543da65"
94
94
  },
95
95
  "publishConfig": {
96
96
  "registry": "https://registry.npmjs.org/"
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=assets.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/@types/assets.d.ts"],"names":[],"mappings":""}