seeonwall 0.1.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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +215 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mateusz Dziurdziak
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# seeonwall
|
|
2
|
+
|
|
3
|
+
Show shoppers a poster on their own wall, at true scale, before they buy.
|
|
4
|
+
|
|
5
|
+
This package loads the [seeonwall.com](https://seeonwall.com) widget into a
|
|
6
|
+
JavaScript storefront — Hydrogen, Next.js, Nuxt, or any app that builds its own
|
|
7
|
+
product pages. If your shop is a Shopify theme or a WooCommerce site, install the
|
|
8
|
+
app or the plugin instead; you do not need this package.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install seeonwall
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
You need a shop id from the [SeeOnWall dashboard](https://seeonwall.com).
|
|
17
|
+
|
|
18
|
+
## Use
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { load } from 'seeonwall'
|
|
22
|
+
|
|
23
|
+
await load({ shopId: 'YOUR_SHOP_ID' })
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That is the whole setup. The package fetches the widget and starts it.
|
|
27
|
+
|
|
28
|
+
Then mark any element on the page as a button mount, and the widget puts a
|
|
29
|
+
"See on wall" button inside it:
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<div class="seeonwall-button"
|
|
33
|
+
data-poster-url="https://example.com/poster.jpg"
|
|
34
|
+
data-poster-width="50"
|
|
35
|
+
data-poster-height="70"></div>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Mounts added later are picked up automatically, so client-side navigation works
|
|
39
|
+
without another call to `load()`.
|
|
40
|
+
|
|
41
|
+
The full list of `data-*` attributes — sizes, frames, passe-partout, per-button
|
|
42
|
+
language — is in the [integration docs](https://seeonwall.com/docs).
|
|
43
|
+
|
|
44
|
+
### Open the preview without a button
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { open } from 'seeonwall'
|
|
48
|
+
|
|
49
|
+
open({
|
|
50
|
+
posterUrl: 'https://example.com/poster.jpg',
|
|
51
|
+
posterWidth: 50,
|
|
52
|
+
posterHeight: 70,
|
|
53
|
+
posterSizes: '30x40,50x70,70x100',
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`open()` waits if the widget is still loading, so calling it on the same tick as
|
|
58
|
+
`load()` is safe.
|
|
59
|
+
|
|
60
|
+
### Clean up
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
import { destroy } from 'seeonwall'
|
|
64
|
+
|
|
65
|
+
destroy()
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Removes the buttons, styles, observers and listeners. Call it when you unmount
|
|
69
|
+
the part of your app that uses SeeOnWall.
|
|
70
|
+
|
|
71
|
+
## API
|
|
72
|
+
|
|
73
|
+
| | |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `load(options)` | Fetches the widget and starts it. Returns a promise. Safe to call more than once — only the first call does work. |
|
|
76
|
+
| `open(params)` | Opens the preview for one poster. |
|
|
77
|
+
| `close()` | Closes the preview. |
|
|
78
|
+
| `setLanguage(lang)` | Changes language at runtime. Only needed if your language switcher does not update `<html lang>`. |
|
|
79
|
+
| `destroy()` | Stops the widget and removes everything it added. |
|
|
80
|
+
| `snippetVersion()` | The loaded widget version, or `null`. Useful in bug reports. |
|
|
81
|
+
|
|
82
|
+
### `load(options)`
|
|
83
|
+
|
|
84
|
+
| option | | |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `shopId` | required | Your shop id. |
|
|
87
|
+
| `lang` | optional | A BCP-47 tag, e.g. `"de"`. Omit it and the language follows `<html lang>`. |
|
|
88
|
+
| `sizeUnit` | optional | `"cm"` (default) or `"in"`. The fallback for sizes that do not state a unit. |
|
|
89
|
+
| `embedUrl` | optional | A different visualizer origin. Only if you proxy the embed. |
|
|
90
|
+
|
|
91
|
+
TypeScript types ship with the package. `PosterParams` and `SizeUnit` are exported.
|
|
92
|
+
|
|
93
|
+
## Notes
|
|
94
|
+
|
|
95
|
+
**Server rendering is safe.** Every function returns quietly when there is no
|
|
96
|
+
`document`, so importing this module on the server does not throw. Call `load()`
|
|
97
|
+
in an effect, or anywhere that runs after hydration.
|
|
98
|
+
|
|
99
|
+
**The widget is fetched at runtime, not bundled.** That is deliberate: fixes reach
|
|
100
|
+
your storefront without you reinstalling a package and redeploying.
|
|
101
|
+
|
|
102
|
+
**ESM only.** The package keeps module state, and a dual CommonJS build would give
|
|
103
|
+
some bundlers two copies of it.
|
|
104
|
+
|
|
105
|
+
**Already have the Shopify app installed?** If a copy of the widget is already on
|
|
106
|
+
the page, this package restarts it on your configuration rather than loading a
|
|
107
|
+
second one.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT — see [LICENSE](./LICENSE).
|
|
112
|
+
|
|
113
|
+
The licence covers this package. Use of the seeonwall.com service needs an account
|
|
114
|
+
and is governed by its [Terms of Service](https://seeonwall.com/terms). SeeOnWall
|
|
115
|
+
is a trademark of Mateusz Dziurdziak; the MIT licence does not grant rights to the
|
|
116
|
+
name or logo.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { PosterParams, SizeUnit } from './types.js';
|
|
2
|
+
export type { PosterParams, SizeUnit };
|
|
3
|
+
export interface LoadOptions {
|
|
4
|
+
/** Your shop id. You get the shop id from the SeeOnWall dashboard. */
|
|
5
|
+
shopId: string;
|
|
6
|
+
/** A different address for the visualizer. Use it only if you proxy the embed. */
|
|
7
|
+
embedUrl?: string;
|
|
8
|
+
/**
|
|
9
|
+
* A BCP-47 language tag, for example "de".
|
|
10
|
+
*
|
|
11
|
+
* If you do not give a value, the snippet reads the language from the
|
|
12
|
+
* `<html lang>` attribute. The snippet then obeys subsequent changes to that
|
|
13
|
+
* attribute. This is usually correct for a single-page application.
|
|
14
|
+
*/
|
|
15
|
+
lang?: string;
|
|
16
|
+
/** The default unit for a size that does not have one. The default is "cm". */
|
|
17
|
+
sizeUnit?: SizeUnit;
|
|
18
|
+
/** A different location for the snippet file. Use this option for tests. */
|
|
19
|
+
scriptUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
/** The interface that seeonwall.js puts on the window object. */
|
|
22
|
+
interface SnippetApi {
|
|
23
|
+
init: () => Promise<void>;
|
|
24
|
+
ready: () => Promise<void>;
|
|
25
|
+
destroy: () => void;
|
|
26
|
+
open: (params: PosterParams) => void;
|
|
27
|
+
close: () => void;
|
|
28
|
+
setLanguage: (lang: string) => void;
|
|
29
|
+
version: string;
|
|
30
|
+
}
|
|
31
|
+
interface SnippetConfig {
|
|
32
|
+
shopId: string;
|
|
33
|
+
embedUrl?: string;
|
|
34
|
+
lang?: string;
|
|
35
|
+
sizeUnit?: SizeUnit;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface Window {
|
|
39
|
+
SeeOnWall?: Partial<SnippetApi>;
|
|
40
|
+
SeeOnWallConfig?: SnippetConfig;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Loads the snippet and starts it for your shop.
|
|
45
|
+
*
|
|
46
|
+
* You can call this function more than one time. Only the first call does work.
|
|
47
|
+
* Thus the function is safe in a React effect. React StrictMode calls an effect
|
|
48
|
+
* two times in development.
|
|
49
|
+
*
|
|
50
|
+
* On the server the function does no work and completes immediately.
|
|
51
|
+
*
|
|
52
|
+
* @returns A promise. The promise completes when the snippet finds the buttons
|
|
53
|
+
* on the page and {@link open} becomes available. If the promise fails, the
|
|
54
|
+
* package stays unloaded. You can then call this function again.
|
|
55
|
+
*/
|
|
56
|
+
export declare function load(options: LoadOptions): Promise<void>;
|
|
57
|
+
/** Opens the preview for one poster. A button on the page is not necessary. */
|
|
58
|
+
export declare function open(params: PosterParams): void;
|
|
59
|
+
/** Closes the preview. The function does nothing if the preview is not open. */
|
|
60
|
+
export declare function close(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Changes the language while the page is open. The function also changes the
|
|
63
|
+
* text of the buttons that are already on the page.
|
|
64
|
+
*
|
|
65
|
+
* From this point the snippet ignores the `<html lang>` attribute. Use this
|
|
66
|
+
* function only if your language selector does not change that attribute.
|
|
67
|
+
*/
|
|
68
|
+
export declare function setLanguage(lang: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Stops the snippet. The function removes the buttons, the styles, the
|
|
71
|
+
* observers and the listeners of the snippet.
|
|
72
|
+
*
|
|
73
|
+
* Call this function when you unmount the part of your application that uses
|
|
74
|
+
* SeeOnWall. The script element stays on the page, because a browser cannot
|
|
75
|
+
* unload a script. A subsequent call to {@link load} restarts this copy. It
|
|
76
|
+
* does not get the file again.
|
|
77
|
+
*/
|
|
78
|
+
export declare function destroy(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the version of the loaded snippet, or null before it loads. Give this
|
|
81
|
+
* value in a bug report.
|
|
82
|
+
*/
|
|
83
|
+
export declare function snippetVersion(): string | null;
|
|
84
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AAYtC,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iEAAiE;AACjE,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACpC,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;QAC/B,eAAe,CAAC,EAAE,aAAa,CAAA;KAChC;CACF;AAwHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxD;AAyBD,+EAA+E;AAC/E,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE/C;AAED,gFAAgF;AAChF,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAY9B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The location of the snippet file.
|
|
3
|
+
*
|
|
4
|
+
* The package gets this file at runtime. The package does not contain the file.
|
|
5
|
+
* Thus a correction to the snippet becomes available to all merchants at the
|
|
6
|
+
* next deployment. A new version of the package is not necessary. Refer to
|
|
7
|
+
* ADR 143.
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_SCRIPT_URL = 'https://seeonwall.com/seeonwall.js';
|
|
10
|
+
let loading = null;
|
|
11
|
+
let api = null;
|
|
12
|
+
/**
|
|
13
|
+
* True when the caller wants the widget to run.
|
|
14
|
+
*
|
|
15
|
+
* load() sets this value and destroy() clears it. The value is necessary because
|
|
16
|
+
* destroy() can occur while load() is still in progress. At that moment there is
|
|
17
|
+
* no widget to stop. When the widget becomes available, load() examines this
|
|
18
|
+
* value and stops the widget immediately.
|
|
19
|
+
*/
|
|
20
|
+
let active = false;
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if the code runs in a browser.
|
|
23
|
+
*
|
|
24
|
+
* A storefront framework also runs this module on the server. Each function
|
|
25
|
+
* below examines this value first and then stops. An error on the server stops
|
|
26
|
+
* the page. A quiet return only delays the buttons until hydration.
|
|
27
|
+
*/
|
|
28
|
+
function isBrowser() {
|
|
29
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Makes the configuration object for the snippet.
|
|
33
|
+
*
|
|
34
|
+
* The function adds a property only if the property has a value. It does not
|
|
35
|
+
* set a property to undefined. The snippet makes a difference between a
|
|
36
|
+
* property that is absent and a property that is empty.
|
|
37
|
+
*/
|
|
38
|
+
function toConfig(options) {
|
|
39
|
+
return {
|
|
40
|
+
shopId: options.shopId,
|
|
41
|
+
...(options.embedUrl !== undefined ? { embedUrl: options.embedUrl } : {}),
|
|
42
|
+
...(options.lang !== undefined ? { lang: options.lang } : {}),
|
|
43
|
+
...(options.sizeUnit !== undefined ? { sizeUnit: options.sizeUnit } : {}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function injectScript(url) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const el = document.createElement('script');
|
|
49
|
+
el.src = url;
|
|
50
|
+
el.async = true;
|
|
51
|
+
el.addEventListener('load', () => { resolve(); }, { once: true });
|
|
52
|
+
el.addEventListener('error', () => { reject(new Error(`[seeonwall] Could not load ${url}.`)); }, { once: true });
|
|
53
|
+
document.head.appendChild(el);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns true if a copy of the snippet on the page is new enough to restart.
|
|
58
|
+
*
|
|
59
|
+
* The function examines every member of the interface, and not only the
|
|
60
|
+
* lifecycle functions. A copy that the loader identifies as possibly old must
|
|
61
|
+
* satisfy the full interface before the loader uses it as such.
|
|
62
|
+
*/
|
|
63
|
+
function isRestartable(candidate) {
|
|
64
|
+
return (typeof candidate.init === 'function' &&
|
|
65
|
+
typeof candidate.ready === 'function' &&
|
|
66
|
+
typeof candidate.destroy === 'function' &&
|
|
67
|
+
typeof candidate.open === 'function' &&
|
|
68
|
+
typeof candidate.close === 'function' &&
|
|
69
|
+
typeof candidate.setLanguage === 'function');
|
|
70
|
+
}
|
|
71
|
+
/** Stops the widget and forgets it. The caller must set `active` first. */
|
|
72
|
+
function stop() {
|
|
73
|
+
const running = api;
|
|
74
|
+
api = null;
|
|
75
|
+
loading = null;
|
|
76
|
+
running?.destroy();
|
|
77
|
+
}
|
|
78
|
+
async function start(options) {
|
|
79
|
+
// Set the configuration before you load or restart the snippet. The snippet
|
|
80
|
+
// reads this global object first. It reads a script tag only after that.
|
|
81
|
+
// Thus the snippet uses your shop id and not the shop id of a Shopify theme
|
|
82
|
+
// extension on the same page.
|
|
83
|
+
window.SeeOnWallConfig = toConfig(options);
|
|
84
|
+
const existing = window.SeeOnWall;
|
|
85
|
+
if (existing && isRestartable(existing)) {
|
|
86
|
+
// A copy of the snippet is already active. The copy can come from a theme
|
|
87
|
+
// extension or from a script tag in the theme. Restart this copy with your
|
|
88
|
+
// configuration. Do not load a second copy. Two copies make two mount
|
|
89
|
+
// observers and two message listeners. Also, if you stop one copy, that
|
|
90
|
+
// copy removes the buttons of the other copy.
|
|
91
|
+
existing.destroy();
|
|
92
|
+
await existing.init();
|
|
93
|
+
return existing;
|
|
94
|
+
}
|
|
95
|
+
if (existing) {
|
|
96
|
+
console.warn('[seeonwall] An older copy of seeonwall.js is on this page and cannot restart. ' +
|
|
97
|
+
'A second copy will load next to it. Update your Shopify theme extension, ' +
|
|
98
|
+
'or remove the script tag that you installed by hand.');
|
|
99
|
+
}
|
|
100
|
+
await injectScript(options.scriptUrl ?? DEFAULT_SCRIPT_URL);
|
|
101
|
+
const loaded = window.SeeOnWall;
|
|
102
|
+
if (!loaded || typeof loaded.ready !== 'function') {
|
|
103
|
+
throw new Error('[seeonwall] The snippet loaded but it did not publish its interface.');
|
|
104
|
+
}
|
|
105
|
+
await loaded.ready();
|
|
106
|
+
return loaded;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Loads the snippet and starts it for your shop.
|
|
110
|
+
*
|
|
111
|
+
* You can call this function more than one time. Only the first call does work.
|
|
112
|
+
* Thus the function is safe in a React effect. React StrictMode calls an effect
|
|
113
|
+
* two times in development.
|
|
114
|
+
*
|
|
115
|
+
* On the server the function does no work and completes immediately.
|
|
116
|
+
*
|
|
117
|
+
* @returns A promise. The promise completes when the snippet finds the buttons
|
|
118
|
+
* on the page and {@link open} becomes available. If the promise fails, the
|
|
119
|
+
* package stays unloaded. You can then call this function again.
|
|
120
|
+
*/
|
|
121
|
+
export function load(options) {
|
|
122
|
+
if (!isBrowser()) {
|
|
123
|
+
return Promise.resolve();
|
|
124
|
+
}
|
|
125
|
+
active = true;
|
|
126
|
+
if (!loading) {
|
|
127
|
+
loading = start(options).then((loaded) => {
|
|
128
|
+
api = loaded;
|
|
129
|
+
// A call to destroy() can occur while the widget loads. The widget
|
|
130
|
+
// starts itself when its script runs, thus the loader must stop it now.
|
|
131
|
+
// Before this point there was no widget to stop.
|
|
132
|
+
if (!active) {
|
|
133
|
+
stop();
|
|
134
|
+
}
|
|
135
|
+
return loaded;
|
|
136
|
+
}, (err) => {
|
|
137
|
+
// Clear the promise. A later call to load() is then a new attempt and
|
|
138
|
+
// not a repetition of this failure. The usual causes are a network
|
|
139
|
+
// problem or a content security policy.
|
|
140
|
+
loading = null;
|
|
141
|
+
throw err;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return loading.then(() => undefined);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Sends work to the loaded snippet.
|
|
148
|
+
*
|
|
149
|
+
* If the snippet is not ready, the function waits for it. Thus a call to open()
|
|
150
|
+
* on the same tick as load() gives a preview. It does not fail quietly.
|
|
151
|
+
*/
|
|
152
|
+
function withApi(action, name) {
|
|
153
|
+
if (!isBrowser()) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (api) {
|
|
157
|
+
action(api);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (loading) {
|
|
161
|
+
void loading.then(action).catch(() => {
|
|
162
|
+
// load() already gave this failure to the caller that waited for it.
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
console.warn(`[seeonwall] You called ${name}() before load(). Call load({ shopId }) first.`);
|
|
167
|
+
}
|
|
168
|
+
/** Opens the preview for one poster. A button on the page is not necessary. */
|
|
169
|
+
export function open(params) {
|
|
170
|
+
withApi((loaded) => { loaded.open(params); }, 'open');
|
|
171
|
+
}
|
|
172
|
+
/** Closes the preview. The function does nothing if the preview is not open. */
|
|
173
|
+
export function close() {
|
|
174
|
+
withApi((loaded) => { loaded.close(); }, 'close');
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Changes the language while the page is open. The function also changes the
|
|
178
|
+
* text of the buttons that are already on the page.
|
|
179
|
+
*
|
|
180
|
+
* From this point the snippet ignores the `<html lang>` attribute. Use this
|
|
181
|
+
* function only if your language selector does not change that attribute.
|
|
182
|
+
*/
|
|
183
|
+
export function setLanguage(lang) {
|
|
184
|
+
withApi((loaded) => { loaded.setLanguage(lang); }, 'setLanguage');
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Stops the snippet. The function removes the buttons, the styles, the
|
|
188
|
+
* observers and the listeners of the snippet.
|
|
189
|
+
*
|
|
190
|
+
* Call this function when you unmount the part of your application that uses
|
|
191
|
+
* SeeOnWall. The script element stays on the page, because a browser cannot
|
|
192
|
+
* unload a script. A subsequent call to {@link load} restarts this copy. It
|
|
193
|
+
* does not get the file again.
|
|
194
|
+
*/
|
|
195
|
+
export function destroy() {
|
|
196
|
+
if (!isBrowser()) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
active = false;
|
|
200
|
+
if (api) {
|
|
201
|
+
stop();
|
|
202
|
+
}
|
|
203
|
+
// If the widget is still in progress, the loader keeps the promise. Thus a
|
|
204
|
+
// subsequent call to load() joins the load that is already in progress. It
|
|
205
|
+
// does not add a second script. If no call to load() occurs, the handler in
|
|
206
|
+
// load() examines `active` and stops the widget.
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Returns the version of the loaded snippet, or null before it loads. Give this
|
|
210
|
+
* value in a bug report.
|
|
211
|
+
*/
|
|
212
|
+
export function snippetVersion() {
|
|
213
|
+
return api?.version ?? null;
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,oCAAoC,CAAA;AA8C/D,IAAI,OAAO,GAA+B,IAAI,CAAA;AAC9C,IAAI,GAAG,GAAsB,IAAI,CAAA;AAEjC;;;;;;;GAOG;AACH,IAAI,MAAM,GAAG,KAAK,CAAA;AAElB;;;;;;GAMG;AACH,SAAS,SAAS;IAChB,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAA;AACzE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,OAAoB;IACpC,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,CAAC,OAAO,CAAC,QAAQ,K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,+EAA+E;AAC/E,MAAM,UAAU,IAAI,CAAC,MAAoB;IACvC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AACtD,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,KAAK;IACnB,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,EAAE,aAAa,CAAC,CAAA;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO;IACrB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACjB,OAAM;IACR,CAAC;IACD,MAAM,GAAG,KAAK,CAAA;IACd,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,EAAE,CAAA;IACR,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,4EAA4E;IAC5E,iDAAiD;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,GAAG,EAAE,OAAO,IAAI,IAAI,CAAA;AAC7B,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The poster contract. This file is a copy of the definition in the snippet.
|
|
3
|
+
* The source files are `integration-snippet/src/config.ts` and
|
|
4
|
+
* `integration-snippet/src/sizeParser.ts`.
|
|
5
|
+
*
|
|
6
|
+
* The package repeats these types. It does not import them. This package has
|
|
7
|
+
* its own public repository, because npm provenance must attest to it. The
|
|
8
|
+
* repository of the snippet is private.
|
|
9
|
+
*
|
|
10
|
+
* A check in the snippet repository compares this file with the source. The
|
|
11
|
+
* check fails when the two files disagree. The check finds a difference, but it
|
|
12
|
+
* cannot prevent one. Thus you must change the source file first. Then copy the
|
|
13
|
+
* new text to this file. Do not do this in the opposite order.
|
|
14
|
+
*
|
|
15
|
+
* The text below the next line is an exact copy. Do not edit the wording, or
|
|
16
|
+
* the check fails.
|
|
17
|
+
*/
|
|
18
|
+
export type SizeUnit = 'cm' | 'in';
|
|
19
|
+
export interface PosterParams {
|
|
20
|
+
posterUrl: string;
|
|
21
|
+
posterTitle?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Fallback unit for any value here that does not state its own (ADR 094).
|
|
24
|
+
* Defaults to "cm". A value that spells out its unit — "24cm", "10in", "a4" —
|
|
25
|
+
* is unaffected by this, so setting it shop-wide can never change the meaning
|
|
26
|
+
* of a number that was already explicit.
|
|
27
|
+
*
|
|
28
|
+
* Also seeds the unit the shopper is shown for wall, frame and mat
|
|
29
|
+
* measurements — they can still switch it in the visualizer.
|
|
30
|
+
*/
|
|
31
|
+
sizeUnit?: SizeUnit;
|
|
32
|
+
/**
|
|
33
|
+
* Poster width. Either a number in {@link sizeUnit}, or a string carrying its
|
|
34
|
+
* own unit — "24cm", "10in", "29,7 cm", '11"' — or a named format such as
|
|
35
|
+
* "a4", which resolves to that format's width (21cm). Declare a named poster
|
|
36
|
+
* by writing the same name in {@link posterHeight}.
|
|
37
|
+
*/
|
|
38
|
+
posterWidth?: number | string;
|
|
39
|
+
/** Poster height. Same forms as {@link posterWidth}; "a4" here is 29.7cm. */
|
|
40
|
+
posterHeight?: number | string;
|
|
41
|
+
/**
|
|
42
|
+
* Comma-separated list of available poster sizes. Each entry is a "WxH" pair
|
|
43
|
+
* that may carry its own unit, or a named format: "30x40,50x70",
|
|
44
|
+
* "12x16in,18x24in", "a4,a3,50x70cm". Entries without a unit fall back to
|
|
45
|
+
* {@link sizeUnit}.
|
|
46
|
+
* When present with more than one entry, the visualizer shows a size selector.
|
|
47
|
+
*/
|
|
48
|
+
posterSizes?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Merchant-declared sub-rectangle of the poster image holding the actual artwork,
|
|
51
|
+
* as "left,top,width,height" percentages (ADR 092).
|
|
52
|
+
*
|
|
53
|
+
* Shops sell with mockup images — the print centred on a coloured field, often
|
|
54
|
+
* framed — and rendering the whole image makes the print come out too small.
|
|
55
|
+
* Forwarded verbatim: the visualizer parses it and ignores anything malformed, so a
|
|
56
|
+
* typo in a theme setting degrades to the uncropped rendering rather than breaking.
|
|
57
|
+
*/
|
|
58
|
+
posterInset?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Explicit product page URL for this poster. When set, bookmarks link to this
|
|
61
|
+
* URL instead of the page where the button was clicked (originPageUrl).
|
|
62
|
+
* Useful on listing/search pages where each poster has its own detail page.
|
|
63
|
+
*/
|
|
64
|
+
productPageUrl?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Per-button language override (BCP-47 tag, e.g. "pl", "de").
|
|
67
|
+
* Read from data-lang on the .seeonwall-button element.
|
|
68
|
+
* When set, this language is used for the button label and forwarded to the
|
|
69
|
+
* visualizer iframe, overriding the global config.lang for this button only.
|
|
70
|
+
*/
|
|
71
|
+
lang?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Width in centimetres of the frame the preview starts with. Omitted or 0 means
|
|
74
|
+
* the poster previews unframed, which is what most shops sell — set this only if
|
|
75
|
+
* the price on the page includes a frame. Shoppers can still add or remove one.
|
|
76
|
+
*/
|
|
77
|
+
frameDefaultCm?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Hex colour of that default frame (e.g. "#3E2723"). Ignored unless
|
|
80
|
+
* frameDefaultCm is greater than 0. Defaults to black.
|
|
81
|
+
*/
|
|
82
|
+
frameDefaultColor?: string;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;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;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The poster contract. This file is a copy of the definition in the snippet.
|
|
3
|
+
* The source files are `integration-snippet/src/config.ts` and
|
|
4
|
+
* `integration-snippet/src/sizeParser.ts`.
|
|
5
|
+
*
|
|
6
|
+
* The package repeats these types. It does not import them. This package has
|
|
7
|
+
* its own public repository, because npm provenance must attest to it. The
|
|
8
|
+
* repository of the snippet is private.
|
|
9
|
+
*
|
|
10
|
+
* A check in the snippet repository compares this file with the source. The
|
|
11
|
+
* check fails when the two files disagree. The check finds a difference, but it
|
|
12
|
+
* cannot prevent one. Thus you must change the source file first. Then copy the
|
|
13
|
+
* new text to this file. Do not do this in the opposite order.
|
|
14
|
+
*
|
|
15
|
+
* The text below the next line is an exact copy. Do not edit the wording, or
|
|
16
|
+
* the check fails.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "seeonwall",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Show shoppers a poster on their own wall, at true scale. The seeonwall.com widget for React and headless storefronts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"seeonwall",
|
|
7
|
+
"poster",
|
|
8
|
+
"wall-art",
|
|
9
|
+
"product-visualization",
|
|
10
|
+
"ecommerce",
|
|
11
|
+
"headless-commerce",
|
|
12
|
+
"shopify",
|
|
13
|
+
"hydrogen",
|
|
14
|
+
"storefront"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Mateusz Dziurdziak",
|
|
18
|
+
"homepage": "https://seeonwall.com",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/seeonwall/seeonwall-npm.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/seeonwall/seeonwall-npm/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"provenance": true
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
52
|
+
"prepublishOnly": "npm run build"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"jsdom": "^30.0.1",
|
|
56
|
+
"typescript": "~6.0.3",
|
|
57
|
+
"vitest": "^4.1.10"
|
|
58
|
+
}
|
|
59
|
+
}
|