@meoslabs/save-in-meos 0.0.3 → 0.0.4

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @meoslabs/save-in-meos
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@meoslabs/save-in-meos.svg?style=flat-square)](https://www.npmjs.com/package/@meoslabs/save-in-meos)
4
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@meoslabs/save-in-meos?style=flat-square)](https://bundlephobia.com/package/@meoslabs/save-in-meos)
5
+ [![CI](https://github.com/meoslabs/save-in-meos/actions/workflows/ci.yml/badge.svg)](https://github.com/meoslabs/save-in-meos/actions/workflows/ci.yml)
6
+ [![license](https://img.shields.io/npm/l/@meoslabs/save-in-meos.svg?style=flat-square)](LICENSE)
7
+ [![live demo](https://img.shields.io/badge/demo-GitHub%20Pages-0366d6?style=flat-square)](https://meoslabs.github.io/save-in-meos/)
8
+ [![jsDelivr hits](https://data.jsdelivr.com/v1/package/npm/@meoslabs/save-in-meos/badge)](https://www.jsdelivr.com/package/npm/@meoslabs/save-in-meos)
9
+
3
10
  **meos deeplink protocol (MDP)** codec and **save in meos** embed widget for third-party sites.
4
11
 
5
12
  Let visitors save a page (or a quote from it) into [meos](https://meos.do) with one tap. This package builds canonical import URLs and ships a branded, self-contained button you can drop into any site — via npm, a script tag, or programmatic imports only.
@@ -22,14 +29,14 @@ Static SVG previews of the branded chip (regenerated from widget SSOT on `npm ru
22
29
  <td><strong>light</strong></td>
23
30
  <td align="center">
24
31
  <img
25
- src="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/assets/preview/chip-default-light.svg"
32
+ src="https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.4/assets/preview/chip-default-light.svg"
26
33
  alt="save in meos chip — default preset, light theme"
27
34
  height="55"
28
35
  />
29
36
  </td>
30
37
  <td align="center">
31
38
  <img
32
- src="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/assets/preview/chip-compact-light.svg"
39
+ src="https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.4/assets/preview/chip-compact-light.svg"
33
40
  alt="save chip — compact preset, light theme"
34
41
  height="52"
35
42
  />
@@ -39,14 +46,14 @@ Static SVG previews of the branded chip (regenerated from widget SSOT on `npm ru
39
46
  <td><strong>dark</strong></td>
40
47
  <td align="center">
41
48
  <img
42
- src="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/assets/preview/chip-default-dark.svg"
49
+ src="https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.4/assets/preview/chip-default-dark.svg"
43
50
  alt="save in meos chip — default preset, dark theme"
44
51
  height="55"
45
52
  />
46
53
  </td>
47
54
  <td align="center">
48
55
  <img
49
- src="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/assets/preview/chip-compact-dark.svg"
56
+ src="https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.4/assets/preview/chip-compact-dark.svg"
50
57
  alt="save chip — compact preset, dark theme"
51
58
  height="52"
52
59
  />
@@ -55,7 +62,7 @@ Static SVG previews of the branded chip (regenerated from widget SSOT on `npm ru
55
62
  </tbody>
56
63
  </table>
57
64
 
58
- Preview assets also ship in-repo at [`assets/preview/`](assets/preview/) and on [jsDelivr](https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.3/assets/preview/chip-default-light.svg).
65
+ Preview assets also ship in-repo at [`assets/preview/`](assets/preview/) and on [jsDelivr](https://cdn.jsdelivr.net/npm/@meoslabs/save-in-meos@0.0.4/assets/preview/chip-default-light.svg).
59
66
 
60
67
  ## How to integrate
61
68
 
@@ -64,7 +71,8 @@ Preview assets also ship in-repo at [`assets/preview/`](assets/preview/) and on
64
71
  | **npm / bundler** | `npm install @meoslabs/save-in-meos` then `import { initSaveButton } from '@meoslabs/save-in-meos'` |
65
72
  | **Script tag (CDN)** | Pin `https://unpkg.com/@meoslabs/save-in-meos@VERSION/dist/widget.iife.js` + `fonts.css` — see [`examples/cdn-demo.html`](examples/cdn-demo.html) |
66
73
  | **Programmatic only** | `import { buildMeosLink, buildImportIntentV1 } from '@meoslabs/save-in-meos'` — no widget CSS required |
67
- | **Local demo** | `npm run demo` then open `http://localhost:4173/demo?local=1` (stages `examples/vendor/` via `build:widget`) |
74
+ | **Live demo** | [meoslabs.github.io/save-in-meos](https://meoslabs.github.io/save-in-meos/) (GitHub Pages) |
75
+ | **Local demo** | `npm run demo` → `http://localhost:4173/demo?local=1` |
68
76
 
69
77
  CDN mirrors (auto-indexed from npm — no separate account):
70
78
 
@@ -117,13 +125,14 @@ Explicit `chip` fields override preset values. Prefer `chipPreset` over hand-rol
117
125
  }
118
126
  ```
119
127
 
120
- **Live examples** (after `npm run demo`):
128
+ **Live examples** ([GitHub Pages](https://meoslabs.github.io/save-in-meos/) or `npm run demo`):
121
129
 
122
130
  | Demo | URL |
123
131
  |------|-----|
124
- | Blog post embed | `http://localhost:4173/demo.html?local=1` |
125
- | Theme + chip presets | `http://localhost:4173/theme-demo.html` |
126
- | CDN copy/paste snippet | `http://localhost:4173/cdn-demo.html` |
132
+ | Index | https://meoslabs.github.io/save-in-meos/ |
133
+ | Blog post embed | https://meoslabs.github.io/save-in-meos/demo.html?local=1 |
134
+ | Theme + chip presets | https://meoslabs.github.io/save-in-meos/theme-demo.html |
135
+ | CDN copy/paste snippet | https://meoslabs.github.io/save-in-meos/cdn-demo.html |
127
136
 
128
137
  See [`docs/INTEGRATOR.md`](docs/INTEGRATOR.md) for the full widget API.
129
138
 
@@ -143,9 +152,9 @@ initSaveButton("#meos-save-mount", {
143
152
  ## Quick start — script tag
144
153
 
145
154
  ```html
146
- <link rel="stylesheet" href="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/src/widget/fonts.css" />
155
+ <link rel="stylesheet" href="https://unpkg.com/@meoslabs/save-in-meos@0.0.4/src/widget/fonts.css" />
147
156
  <div id="meos-save-mount"></div>
148
- <script src="https://unpkg.com/@meoslabs/save-in-meos@0.0.3/dist/widget.iife.js"></script>
157
+ <script src="https://unpkg.com/@meoslabs/save-in-meos@0.0.4/dist/widget.iife.js"></script>
149
158
  <script>
150
159
  MeosSave.initSaveButton("#meos-save-mount", {
151
160
  u: location.href,
@@ -118,7 +118,7 @@ ${Ei}
118
118
 
119
119
  ${Ei}
120
120
  `,pl=`${Mt}
121
- ${Ut}`;var Qo="save in meos";var el="meos-save-chip",tl="meos-save-chip__icon",nl="meos-save-chip__label",Si="meos-save-widget-styles",Ii="data-meos-save-host",Nt=Symbol("meos-wire-click-abort"),Zt=!1;function Bt(e){let n=Ot(e);return`${ki(tl)}<span class="${nl}">${n}</span>`}function il(){if(Zt||typeof document>"u")return;if(document.getElementById(Si)){Zt=!0;return}let e=document.createElement("style");e.id=Si,e.setAttribute("data-meos-save",""),e.textContent=Ut,document.head.appendChild(e),Zt=!0}function al(e){return e.childNodes.length===0&&!e.textContent?.trim()}function $t(e,n){e.type="button",e.className=el,e.setAttribute("data-meos-save",""),e.setAttribute("aria-label",Qo),n==="compact"&&e.setAttribute("data-meos-chip-preset","compact"),e.innerHTML=Bt(n)}function rl(e){let n=e.shadowRoot?.querySelector("button");return n instanceof HTMLButtonElement?n:null}function ol(e,n){Dt(e,n.theme??"auto",n.chip,n.chipPreset),e.setAttribute(Ii,"");let t=rl(e);if(t)return $t(t,n.chipPreset),Ht(t,n,!0),t;let i=e.attachShadow({mode:"closed"}),a=document.createElement("style");a.textContent=Mt,i.appendChild(a);let r=document.createElement("button");return $t(r,n.chipPreset),i.appendChild(r),Ht(r,n),r}function Ht(e,n,t=!1){let i=e;t&&i[Nt]&&i[Nt].abort();let a=new AbortController;i[Nt]=a;let r;e.addEventListener("pointerdown",()=>{r=yi()},{signal:a.signal}),e.addEventListener("click",s=>{s.preventDefault();try{let l=typeof location<"u"?location.href:n.u??"",d=Xe({u:l,t:n.t??yi()??r,images:n.images,blocks:n.blocks}),o=je(d,n.widgetId);typeof location<"u"&&(location.href=o)}catch(l){console.error("[save-in-meos] failed to build import link",l)}},{signal:a.signal})}function Ai(e,n={u:typeof location<"u"?location.href:""}){let t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;if(al(t)||t.hasAttribute(Ii))return ol(t,n);il();let i;return t instanceof HTMLButtonElement?i=t:t instanceof HTMLAnchorElement?(i=document.createElement("button"),i.type="button",t.replaceWith(i)):(i=document.createElement("button"),t.appendChild(i)),$t(i,n.chipPreset),Dt(i,n.theme??"auto",n.chip,n.chipPreset),Ht(i,n,!0),i}function yi(){if(typeof window>"u"||!window.getSelection)return;let e=window.getSelection()?.toString().trim();return e&&e.length>0?e:void 0}var ll="0.0.3";return Oi(sl);})();
121
+ ${Ut}`;var Qo="save in meos";var el="meos-save-chip",tl="meos-save-chip__icon",nl="meos-save-chip__label",Si="meos-save-widget-styles",Ii="data-meos-save-host",Nt=Symbol("meos-wire-click-abort"),Zt=!1;function Bt(e){let n=Ot(e);return`${ki(tl)}<span class="${nl}">${n}</span>`}function il(){if(Zt||typeof document>"u")return;if(document.getElementById(Si)){Zt=!0;return}let e=document.createElement("style");e.id=Si,e.setAttribute("data-meos-save",""),e.textContent=Ut,document.head.appendChild(e),Zt=!0}function al(e){return e.childNodes.length===0&&!e.textContent?.trim()}function $t(e,n){e.type="button",e.className=el,e.setAttribute("data-meos-save",""),e.setAttribute("aria-label",Qo),n==="compact"&&e.setAttribute("data-meos-chip-preset","compact"),e.innerHTML=Bt(n)}function rl(e){let n=e.shadowRoot?.querySelector("button");return n instanceof HTMLButtonElement?n:null}function ol(e,n){Dt(e,n.theme??"auto",n.chip,n.chipPreset),e.setAttribute(Ii,"");let t=rl(e);if(t)return $t(t,n.chipPreset),Ht(t,n,!0),t;let i=e.attachShadow({mode:"closed"}),a=document.createElement("style");a.textContent=Mt,i.appendChild(a);let r=document.createElement("button");return $t(r,n.chipPreset),i.appendChild(r),Ht(r,n),r}function Ht(e,n,t=!1){let i=e;t&&i[Nt]&&i[Nt].abort();let a=new AbortController;i[Nt]=a;let r;e.addEventListener("pointerdown",()=>{r=yi()},{signal:a.signal}),e.addEventListener("click",s=>{s.preventDefault();try{let l=typeof location<"u"?location.href:n.u??"",d=Xe({u:l,t:n.t??yi()??r,images:n.images,blocks:n.blocks}),o=je(d,n.widgetId);typeof location<"u"&&(location.href=o)}catch(l){console.error("[save-in-meos] failed to build import link",l)}},{signal:a.signal})}function Ai(e,n={u:typeof location<"u"?location.href:""}){let t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;if(al(t)||t.hasAttribute(Ii))return ol(t,n);il();let i;return t instanceof HTMLButtonElement?i=t:t instanceof HTMLAnchorElement?(i=document.createElement("button"),i.type="button",t.replaceWith(i)):(i=document.createElement("button"),t.appendChild(i)),$t(i,n.chipPreset),Dt(i,n.theme??"auto",n.chip,n.chipPreset),Ht(i,n,!0),i}function yi(){if(typeof window>"u"||!window.getSelection)return;let e=window.getSelection()?.toString().trim();return e&&e.length>0?e:void 0}var ll="0.0.4";return Oi(sl);})();
122
122
  /*! Bundled license information:
123
123
 
124
124
  pako/dist/pako.esm.mjs:
@@ -118,7 +118,7 @@ ${Ei}
118
118
 
119
119
  ${Ei}
120
120
  `,pl=`${Mt}
121
- ${Ut}`;var Qo="save in meos";var el="meos-save-chip",tl="meos-save-chip__icon",nl="meos-save-chip__label",Si="meos-save-widget-styles",Ii="data-meos-save-host",Nt=Symbol("meos-wire-click-abort"),Zt=!1;function Bt(e){let n=Ot(e);return`${ki(tl)}<span class="${nl}">${n}</span>`}function il(){if(Zt||typeof document>"u")return;if(document.getElementById(Si)){Zt=!0;return}let e=document.createElement("style");e.id=Si,e.setAttribute("data-meos-save",""),e.textContent=Ut,document.head.appendChild(e),Zt=!0}function al(e){return e.childNodes.length===0&&!e.textContent?.trim()}function $t(e,n){e.type="button",e.className=el,e.setAttribute("data-meos-save",""),e.setAttribute("aria-label",Qo),n==="compact"&&e.setAttribute("data-meos-chip-preset","compact"),e.innerHTML=Bt(n)}function rl(e){let n=e.shadowRoot?.querySelector("button");return n instanceof HTMLButtonElement?n:null}function ol(e,n){Dt(e,n.theme??"auto",n.chip,n.chipPreset),e.setAttribute(Ii,"");let t=rl(e);if(t)return $t(t,n.chipPreset),Ht(t,n,!0),t;let i=e.attachShadow({mode:"closed"}),a=document.createElement("style");a.textContent=Mt,i.appendChild(a);let r=document.createElement("button");return $t(r,n.chipPreset),i.appendChild(r),Ht(r,n),r}function Ht(e,n,t=!1){let i=e;t&&i[Nt]&&i[Nt].abort();let a=new AbortController;i[Nt]=a;let r;e.addEventListener("pointerdown",()=>{r=yi()},{signal:a.signal}),e.addEventListener("click",s=>{s.preventDefault();try{let l=typeof location<"u"?location.href:n.u??"",d=Xe({u:l,t:n.t??yi()??r,images:n.images,blocks:n.blocks}),o=je(d,n.widgetId);typeof location<"u"&&(location.href=o)}catch(l){console.error("[save-in-meos] failed to build import link",l)}},{signal:a.signal})}function Ai(e,n={u:typeof location<"u"?location.href:""}){let t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;if(al(t)||t.hasAttribute(Ii))return ol(t,n);il();let i;return t instanceof HTMLButtonElement?i=t:t instanceof HTMLAnchorElement?(i=document.createElement("button"),i.type="button",t.replaceWith(i)):(i=document.createElement("button"),t.appendChild(i)),$t(i,n.chipPreset),Dt(i,n.theme??"auto",n.chip,n.chipPreset),Ht(i,n,!0),i}function yi(){if(typeof window>"u"||!window.getSelection)return;let e=window.getSelection()?.toString().trim();return e&&e.length>0?e:void 0}var ll="0.0.3";return Oi(sl);})();
121
+ ${Ut}`;var Qo="save in meos";var el="meos-save-chip",tl="meos-save-chip__icon",nl="meos-save-chip__label",Si="meos-save-widget-styles",Ii="data-meos-save-host",Nt=Symbol("meos-wire-click-abort"),Zt=!1;function Bt(e){let n=Ot(e);return`${ki(tl)}<span class="${nl}">${n}</span>`}function il(){if(Zt||typeof document>"u")return;if(document.getElementById(Si)){Zt=!0;return}let e=document.createElement("style");e.id=Si,e.setAttribute("data-meos-save",""),e.textContent=Ut,document.head.appendChild(e),Zt=!0}function al(e){return e.childNodes.length===0&&!e.textContent?.trim()}function $t(e,n){e.type="button",e.className=el,e.setAttribute("data-meos-save",""),e.setAttribute("aria-label",Qo),n==="compact"&&e.setAttribute("data-meos-chip-preset","compact"),e.innerHTML=Bt(n)}function rl(e){let n=e.shadowRoot?.querySelector("button");return n instanceof HTMLButtonElement?n:null}function ol(e,n){Dt(e,n.theme??"auto",n.chip,n.chipPreset),e.setAttribute(Ii,"");let t=rl(e);if(t)return $t(t,n.chipPreset),Ht(t,n,!0),t;let i=e.attachShadow({mode:"closed"}),a=document.createElement("style");a.textContent=Mt,i.appendChild(a);let r=document.createElement("button");return $t(r,n.chipPreset),i.appendChild(r),Ht(r,n),r}function Ht(e,n,t=!1){let i=e;t&&i[Nt]&&i[Nt].abort();let a=new AbortController;i[Nt]=a;let r;e.addEventListener("pointerdown",()=>{r=yi()},{signal:a.signal}),e.addEventListener("click",s=>{s.preventDefault();try{let l=typeof location<"u"?location.href:n.u??"",d=Xe({u:l,t:n.t??yi()??r,images:n.images,blocks:n.blocks}),o=je(d,n.widgetId);typeof location<"u"&&(location.href=o)}catch(l){console.error("[save-in-meos] failed to build import link",l)}},{signal:a.signal})}function Ai(e,n={u:typeof location<"u"?location.href:""}){let t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;if(al(t)||t.hasAttribute(Ii))return ol(t,n);il();let i;return t instanceof HTMLButtonElement?i=t:t instanceof HTMLAnchorElement?(i=document.createElement("button"),i.type="button",t.replaceWith(i)):(i=document.createElement("button"),t.appendChild(i)),$t(i,n.chipPreset),Dt(i,n.theme??"auto",n.chip,n.chipPreset),Ht(i,n,!0),i}function yi(){if(typeof window>"u"||!window.getSelection)return;let e=window.getSelection()?.toString().trim();return e&&e.length>0?e:void 0}var ll="0.0.4";return Oi(sl);})();
122
122
  /*! Bundled license information:
123
123
 
124
124
  pako/dist/pako.esm.mjs:
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@meoslabs/save-in-meos",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "meos deeplink protocol (MDP) codec and save-in-meos embed widget for third-party sites",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/meoslabs/save-in-meos.git"
8
8
  },
9
- "homepage": "https://github.com/meoslabs/save-in-meos#readme",
9
+ "homepage": "https://meoslabs.github.io/save-in-meos/",
10
10
  "bugs": {
11
11
  "url": "https://github.com/meoslabs/save-in-meos/issues"
12
12
  },
@@ -65,7 +65,9 @@
65
65
  "check:mdp": "npm run check:mdp-contract && npm run check:widget-branding",
66
66
  "check:public-scrub": "tsx scripts/check-public-scrub.ts",
67
67
  "check:ci": "tsx scripts/check-ci-workflows.ts",
68
- "prepublishOnly": "npm run build && npm run build:widget && npm run check:mdp && npm run check:public-scrub",
68
+ "check:version-pins": "tsx scripts/check-version-pins.ts",
69
+ "version:sync": "tsx scripts/sync-version.ts --build",
70
+ "prepublishOnly": "npm run build && npm run build:widget && npm run check:mdp && npm run check:public-scrub && npm run check:version-pins",
69
71
  "prepare": "husky"
70
72
  },
71
73
  "keywords": [