seeonwall 0.7.0 → 0.9.0
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/README.md +38 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +36 -6
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +16 -2
- package/dist/react.js.map +1 -1
- package/dist/types.d.ts +19 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -6
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,8 @@ Everything in `PosterParams`, plus:
|
|
|
59
59
|
| `fullWidth` | boolean | Stretches the button to the width of its container. |
|
|
60
60
|
| `backgroundColor`, `textColor`, `borderRadius`, `borderColor` | | Button appearance. |
|
|
61
61
|
| `buttonClassName` | | Your theme's classes, added after the widget's own. |
|
|
62
|
-
| `
|
|
62
|
+
| `buttonText` | string or object | Your own label, for one language or for each. |
|
|
63
|
+
| `matchButton` | selector | Copies shape, size and typography from one of your own buttons. |
|
|
63
64
|
| `matchColors` | boolean | Also copies its colours. |
|
|
64
65
|
|
|
65
66
|
### Button shapes
|
|
@@ -78,9 +79,10 @@ they are. The two are independent, so any shape can carry your colours or your t
|
|
|
78
79
|
<SeeOnWallButton posterUrl={product.image} variant="glyph" />
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
Every shape carries the SeeOnWall mark. A shape decides what is drawn around the mark,
|
|
82
|
-
whether it is there — `icon` is simply the shape with nothing else left. On the free plan
|
|
83
|
-
mark is the
|
|
82
|
+
Every shape carries the same SeeOnWall mark. A shape decides what is drawn around the mark,
|
|
83
|
+
not whether it is there — `icon` is simply the shape with nothing else left. On the free plan
|
|
84
|
+
the mark is drawn in the brand orange rather than the colour of the label beside it; that is
|
|
85
|
+
the whole of the free-plan branding, and it shows on the shapes with no fill of their own.
|
|
84
86
|
|
|
85
87
|
The three shapes with no fill take their colour from the text around them, so they suit a
|
|
86
88
|
light or a dark theme with nothing to set. That also decides which colour props have
|
|
@@ -90,8 +92,12 @@ the mark, and the `outline` border when `borderColor` is absent. Passing a colou
|
|
|
90
92
|
cannot use is harmless; it applies again as soon as you change back to a shape that can.
|
|
91
93
|
|
|
92
94
|
`glyph` and `icon` ignore `matchButton`: they draw no box to match, and they take the host
|
|
93
|
-
page's own font. `outline` still matches shape and typography, but not colours — a
|
|
94
|
-
picked against a filled Add to cart disappears on your page background.
|
|
95
|
+
page's own font. `outline` still matches shape, size and typography, but not colours — a
|
|
96
|
+
colour picked against a filled Add to cart disappears on your page background.
|
|
97
|
+
|
|
98
|
+
A matched button also takes the width of the button it copies: a pixel floor when your theme
|
|
99
|
+
sizes that button to its own content, so a longer label still fits, and the full width of the
|
|
100
|
+
row when your theme stretches it, so the pair stays side by side at every breakpoint.
|
|
95
101
|
|
|
96
102
|
`fullWidth` stretches `solid`, `outline` and `glyph` to the width of the element that holds
|
|
97
103
|
them. `icon` stays 40px square whatever you pass — a wide button with one mark in it is a
|
|
@@ -100,6 +106,29 @@ target a shopper cannot read.
|
|
|
100
106
|
Under `icon` the label is still resolved and translated as usual. It becomes the button's
|
|
101
107
|
accessible name and its tooltip, so a screen reader still announces it.
|
|
102
108
|
|
|
109
|
+
### The label
|
|
110
|
+
|
|
111
|
+
The widget labels the button itself, in each of the languages it knows, and follows
|
|
112
|
+
`<html lang>` at runtime. Pass `buttonText` when your own wording should win:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<SeeOnWallButton posterUrl={product.image} buttonText="Preview on my wall" />
|
|
116
|
+
|
|
117
|
+
<SeeOnWallButton
|
|
118
|
+
posterUrl={product.image}
|
|
119
|
+
buttonText={{ en: 'Preview on my wall', de: 'An meiner Wand ansehen' }}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
A string is used in every language. An object replaces the label of the languages it names
|
|
124
|
+
and leaves the rest translated, so a shop that has wording for two of its languages keeps the
|
|
125
|
+
widget's wording for the others. The keys are the languages in `BUTTON_TEXT_LANGS`, exported
|
|
126
|
+
from the package: `en`, `pl`, `de`, `es`, `fr`, `it`, `pt`, `nl`, `sv`, `nb`, `da`. A shopper on any
|
|
127
|
+
other language reads the English label, and your English override if you set one.
|
|
128
|
+
|
|
129
|
+
Under `icon` the label is still resolved and translated — it becomes the accessible name and
|
|
130
|
+
the tooltip — so this prop reaches a screen reader on a button that shows no text.
|
|
131
|
+
|
|
103
132
|
### Sizes from a control on the page
|
|
104
133
|
|
|
105
134
|
Some shops keep the print size in the size control the shopper uses — a dropdown or a set of
|
|
@@ -153,6 +182,9 @@ The shapes above are `data-button-variant="outline" | "glyph" | "icon"` on the m
|
|
|
153
182
|
`data-button-width="full"` stretches the button to its container. `data-sizes-from="auto"`, or a
|
|
154
183
|
selector in the same attribute, reads the sizes from a size control on the page.
|
|
155
184
|
|
|
185
|
+
`data-button-text-en`, and the same attribute for any other language of `BUTTON_TEXT_LANGS`,
|
|
186
|
+
replaces the label the widget would write.
|
|
187
|
+
|
|
156
188
|
The full list of `data-*` attributes — sizes, frames, passe-partout, per-button
|
|
157
189
|
language — is in the [integration docs](https://seeonwall.com/docs).
|
|
158
190
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PosterParams, SizeUnit } from './types.js';
|
|
2
|
-
export
|
|
2
|
+
export { BUTTON_TEXT_LANGS } from './types.js';
|
|
3
|
+
export type { PosterParams, SizeUnit, ButtonTextLang } from './types.js';
|
|
3
4
|
/** The safe storefront state returned by the readiness refresh. */
|
|
4
5
|
export type StorefrontSessionState = 'none' | 'creating' | 'ready' | 'expired';
|
|
5
6
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE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wBAAgB,mBAAmB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAKrE;AAED,gGAAgG;AAChG,wBAAgB,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAe5E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAiBhG;AAaD;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAY9B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AA+B9C,MAAM,WAAW,GAAiC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,oCAAoC,CAAA;AAuD/D,IAAI,OAAO,GAA+B,IAAI,CAAA;AAC9C,IAAI,GAAG,GAAsB,IAAI,CAAA;AAEjC;;;;;;;;;GASG;AACH,IAAI,aAAa,GAAyB,IAAI,CAAA;AAC9C,IAAI,aAAa,GAAwB,IAAI,CAAA;AAE7C,SAAS,cAAc;IACrB,MAAM,OAAO,GAAG,aAAa,CAAA;IAC7B,aAAa,GAAG,IAAI,CAAA;IACpB,aAAa,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,EAAE,CAAA;AACb,CAAC;AAED;;;;;;;GAOG;AACH,IAAI,MAAM,GAAG,KAAK,CAAA;AAElB;;;;;;GAMG;AACH,SAAS,SAAS;IACh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3
|
-
|
|
2
|
+
import { BUTTON_TEXT_LANGS } from './index.js';
|
|
3
|
+
import type { ButtonTextLang, LoadOptions, PosterParams } from './index.js';
|
|
4
|
+
export { BUTTON_TEXT_LANGS };
|
|
5
|
+
export type { ButtonTextLang, LoadOptions, PosterParams };
|
|
4
6
|
/**
|
|
5
7
|
* Loads the widget while a component is on the page.
|
|
6
8
|
*
|
|
@@ -37,9 +39,13 @@ export declare function useSessionReady(): boolean;
|
|
|
37
39
|
* - `glyph` the mark and the label, with no box.
|
|
38
40
|
* - `icon` the mark alone.
|
|
39
41
|
*
|
|
40
|
-
* Each shape carries the mark. A shape says what is drawn around the mark. It does not
|
|
41
|
-
* if the mark is there. `icon` is only the extreme of that: the shape with nothing else
|
|
42
|
-
* it.
|
|
42
|
+
* Each shape carries the same mark. A shape says what is drawn around the mark. It does not
|
|
43
|
+
* say if the mark is there. `icon` is only the extreme of that: the shape with nothing else
|
|
44
|
+
* in it.
|
|
45
|
+
*
|
|
46
|
+
* On the free plan the mark is drawn in the brand colour, and not in the colour of the label
|
|
47
|
+
* beside it. That is the full extent of the branding, and it is visible on the shapes that
|
|
48
|
+
* carry no fill of ours.
|
|
43
49
|
*/
|
|
44
50
|
export type ButtonVariant = 'solid' | 'outline' | 'glyph' | 'icon';
|
|
45
51
|
/** The appearance settings that a merchant can set for one button. */
|
|
@@ -85,12 +91,36 @@ export interface SeeOnWallButtonStyleProps {
|
|
|
85
91
|
buttonClassName?: string;
|
|
86
92
|
/**
|
|
87
93
|
* A CSS selector for a button of your theme to copy. The widget copies the
|
|
88
|
-
* shape and the typography of that button. It does not copy the
|
|
94
|
+
* shape, the size and the typography of that button. It does not copy the
|
|
95
|
+
* colours.
|
|
96
|
+
*
|
|
97
|
+
* The width comes with the size. A theme button that is as wide as its own
|
|
98
|
+
* label gives a floor in pixels, because your label is a different string and
|
|
99
|
+
* can need more room. A theme button that fills its row gives the full width
|
|
100
|
+
* of the row, thus the two buttons stay together at every width of the page.
|
|
89
101
|
*
|
|
90
102
|
* The shapes with no box, `"glyph"` and `"icon"`, do not copy a button. There
|
|
91
103
|
* is no box to copy, and they take the font of the page.
|
|
92
104
|
*/
|
|
93
105
|
matchButton?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Your own label for the button, in place of the label of the widget.
|
|
108
|
+
*
|
|
109
|
+
* Give one string to use the same label in every language. Give an object to
|
|
110
|
+
* write a label for each language, for example
|
|
111
|
+
* `{ en: 'Preview on my wall', de: 'An meiner Wand ansehen' }`. A language
|
|
112
|
+
* that the object does not name keeps the label of the widget, thus you name
|
|
113
|
+
* only the languages that you want to change.
|
|
114
|
+
*
|
|
115
|
+
* The keys are the languages of {@link BUTTON_TEXT_LANGS}. A shopper whose
|
|
116
|
+
* language is not one of them reads the English label, and the English label
|
|
117
|
+
* of this object if you give one.
|
|
118
|
+
*
|
|
119
|
+
* Under the `"icon"` shape the label is still the accessible name and the
|
|
120
|
+
* tooltip of the button. Thus this value reaches a screen reader even where
|
|
121
|
+
* the button shows no text.
|
|
122
|
+
*/
|
|
123
|
+
buttonText?: string | Partial<Record<ButtonTextLang, string>>;
|
|
94
124
|
/**
|
|
95
125
|
* Copies the colours of the button named in `matchButton` as well.
|
|
96
126
|
*
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,EAAiD,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE3E,OAAO,EAAE,i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qD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAiBD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAwFzE"}
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useSyncExternalStore } from 'react';
|
|
3
|
-
import { load, destroy, isSessionReady, on, whenLoaded } from './index.js';
|
|
3
|
+
import { load, destroy, isSessionReady, on, whenLoaded, BUTTON_TEXT_LANGS } from './index.js';
|
|
4
|
+
export { BUTTON_TEXT_LANGS };
|
|
4
5
|
/**
|
|
5
6
|
* The number of components that use the widget at this moment.
|
|
6
7
|
*
|
|
@@ -99,7 +100,7 @@ function attr(target, name, value) {
|
|
|
99
100
|
* arrives.
|
|
100
101
|
*/
|
|
101
102
|
export function SeeOnWallButton(props) {
|
|
102
|
-
const { posterUrl, posterTitle, sizeUnit, posterWidth, posterHeight, posterSizes, sizesFrom, posterInset, productPageUrl, lang, frameDefaultCm, frameDefaultColor, framePreset, variant, fullWidth, backgroundColor, textColor, borderRadius, borderColor, buttonClassName, matchButton, matchColors, className, style, } = props;
|
|
103
|
+
const { posterUrl, posterTitle, sizeUnit, posterWidth, posterHeight, posterSizes, sizesFrom, posterInset, productPageUrl, lang, frameDefaultCm, frameDefaultColor, framePreset, variant, fullWidth, backgroundColor, textColor, borderRadius, borderColor, buttonClassName, buttonText, matchButton, matchColors, className, style, } = props;
|
|
103
104
|
const attributes = {};
|
|
104
105
|
attr(attributes, 'data-poster-url', posterUrl);
|
|
105
106
|
attr(attributes, 'data-poster-title', posterTitle);
|
|
@@ -129,6 +130,19 @@ export function SeeOnWallButton(props) {
|
|
|
129
130
|
attr(attributes, 'data-border-radius', borderRadius);
|
|
130
131
|
attr(attributes, 'data-border-color', borderColor);
|
|
131
132
|
attr(attributes, 'data-button-class', buttonClassName);
|
|
133
|
+
// One attribute for each language, because the widget reads the attribute of
|
|
134
|
+
// the language of the shopper and of no other language. A single string is
|
|
135
|
+
// therefore the same string in every one of them.
|
|
136
|
+
if (typeof buttonText === 'string') {
|
|
137
|
+
for (const lang of BUTTON_TEXT_LANGS) {
|
|
138
|
+
attr(attributes, `data-button-text-${lang}`, buttonText);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (buttonText) {
|
|
142
|
+
for (const [lang, text] of Object.entries(buttonText)) {
|
|
143
|
+
attr(attributes, `data-button-text-${lang}`, text);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
132
146
|
attr(attributes, 'data-match-button', matchButton);
|
|
133
147
|
if (matchColors === true) {
|
|
134
148
|
attributes['data-match-colors'] = 'true';
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG7F,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAG5B;;;;;;;GAOG;AACH,IAAI,SAAS,GAAG,CAAC,CAAA;AAEjB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,OAAoB;IAC/C,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAA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D,6EAA6E;IAC7E,2EAA2E;IAC3E,kDAAkD;IAClD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;YACrC,IAAI,CAAC,UAAU,EAAE,oBAAoB,IAAI,EAAE,EAAE,UAAU,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,UAAU,EAAE,oBAAoB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;QACpD,CAAC;IACH,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,mBAAmB,EAAE,WAAW,CAAC,CAAA;IAClD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,UAAU,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAA;IAC1C,CAAC;IAED,8EAA8E;IAC9E,6CAA6C;IAC7C,OAAO,CACL,cACE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAC3E,KAAK,EAAE,KAAK,KACR,UAAU,GACd,CACH,CAAA;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The poster contract
|
|
3
|
-
* The source files are
|
|
4
|
-
* `integration-snippet/src/sizeParser.ts
|
|
2
|
+
* The poster contract, and the languages that a button label can carry. This
|
|
3
|
+
* file is a copy of the definitions in the snippet. The source files are
|
|
4
|
+
* `integration-snippet/src/config.ts`, `integration-snippet/src/sizeParser.ts`
|
|
5
|
+
* and `integration-snippet/src/i18n.ts`.
|
|
5
6
|
*
|
|
6
7
|
* The package repeats these types. It does not import them. This package has
|
|
7
8
|
* its own public repository, because npm provenance must attest to it. The
|
|
@@ -12,8 +13,10 @@
|
|
|
12
13
|
* cannot prevent one. Thus you must change the source file first. Then copy the
|
|
13
14
|
* new text to this file. Do not do this in the opposite order.
|
|
14
15
|
*
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
16
|
+
* The check compares three declarations: `SizeUnit`, `PosterParams` and
|
|
17
|
+
* `BUTTON_TEXT_LANGS`. Each of them is an exact copy. Do not edit the wording
|
|
18
|
+
* inside them, or the check fails. The comments above them are the comments of
|
|
19
|
+
* this package, and the check does not read them.
|
|
17
20
|
*/
|
|
18
21
|
export type SizeUnit = 'cm' | 'in';
|
|
19
22
|
export interface PosterParams {
|
|
@@ -114,4 +117,15 @@ export interface PosterParams {
|
|
|
114
117
|
*/
|
|
115
118
|
framePreset?: string;
|
|
116
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* The languages that a button can carry a label of your own in.
|
|
122
|
+
*
|
|
123
|
+
* The widget has a label for each of these languages, and a shop can replace
|
|
124
|
+
* the label of any of them. Refer to `buttonText` in the React layer. A
|
|
125
|
+
* language that is not in this list gets the English label, and the English
|
|
126
|
+
* replacement if you give one.
|
|
127
|
+
*/
|
|
128
|
+
export declare const BUTTON_TEXT_LANGS: readonly ["en", "pl", "de", "es", "fr", "it", "pt", "nl", "sv", "nb", "da"];
|
|
129
|
+
/** One language of {@link BUTTON_TEXT_LANGS}. */
|
|
130
|
+
export type ButtonTextLang = (typeof BUTTON_TEXT_LANGS)[number];
|
|
117
131
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAA;AAElC,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,6EAA8E,CAAA;AAE5G,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The poster contract
|
|
3
|
-
* The source files are
|
|
4
|
-
* `integration-snippet/src/sizeParser.ts
|
|
2
|
+
* The poster contract, and the languages that a button label can carry. This
|
|
3
|
+
* file is a copy of the definitions in the snippet. The source files are
|
|
4
|
+
* `integration-snippet/src/config.ts`, `integration-snippet/src/sizeParser.ts`
|
|
5
|
+
* and `integration-snippet/src/i18n.ts`.
|
|
5
6
|
*
|
|
6
7
|
* The package repeats these types. It does not import them. This package has
|
|
7
8
|
* its own public repository, because npm provenance must attest to it. The
|
|
@@ -12,8 +13,18 @@
|
|
|
12
13
|
* cannot prevent one. Thus you must change the source file first. Then copy the
|
|
13
14
|
* new text to this file. Do not do this in the opposite order.
|
|
14
15
|
*
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
16
|
+
* The check compares three declarations: `SizeUnit`, `PosterParams` and
|
|
17
|
+
* `BUTTON_TEXT_LANGS`. Each of them is an exact copy. Do not edit the wording
|
|
18
|
+
* inside them, or the check fails. The comments above them are the comments of
|
|
19
|
+
* this package, and the check does not read them.
|
|
17
20
|
*/
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The languages that a button can carry a label of your own in.
|
|
23
|
+
*
|
|
24
|
+
* The widget has a label for each of these languages, and a shop can replace
|
|
25
|
+
* the label of any of them. Refer to `buttonText` in the React layer. A
|
|
26
|
+
* language that is not in this list gets the English label, and the English
|
|
27
|
+
* replacement if you give one.
|
|
28
|
+
*/
|
|
29
|
+
export const BUTTON_TEXT_LANGS = ['en', 'pl', 'de', 'es', 'fr', 'it', 'pt', 'nl', 'sv', 'nb', 'da'];
|
|
19
30
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAuGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA"}
|