mnfst 0.5.231 → 0.5.232
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/lib/manifest.appwrite.data.js +1 -1
- package/lib/manifest.components.js +8 -0
- package/lib/manifest.css +341 -424
- package/lib/manifest.d.ts +170 -39
- package/lib/manifest.data.js +1 -1
- package/lib/manifest.defer.js +1 -1
- package/lib/manifest.dropdowns.js +2 -0
- package/lib/manifest.edit.css +87 -150
- package/lib/manifest.edit.js +2324 -1076
- package/lib/manifest.integrity.json +10 -10
- package/lib/manifest.js +119 -25
- package/lib/manifest.min.css +1 -1
- package/lib/manifest.rich.text.css +253 -0
- package/lib/{manifest.text.edit.js → manifest.rich.text.js} +1153 -736
- package/lib/manifest.router.js +8 -0
- package/lib/manifest.sw.js +1 -1
- package/package.json +2 -1
- package/lib/manifest.text.edit.css +0 -273
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest.appwrite.auth.js": "sha384-dsIWnH0qCAGSzAXMGrd8fvOrVl4tOIE6j5tC35JPTrQXZ56qLD36ARyvhR7vi3Id",
|
|
3
|
-
"manifest.appwrite.data.js": "sha384-
|
|
3
|
+
"manifest.appwrite.data.js": "sha384-enlQBS4B79OAlkgYX0qon8pnr3Twc7O1iGtiQ+L+Hqgoi+rCKA3FOUFrTBuhprxV",
|
|
4
4
|
"manifest.appwrite.presences.js": "sha384-JyVDWFT69b7Svq8J8p9tNWe2v9PZNQBY5UyhtOl1vnuHFAX0CRQ3MA9SiKq5wzNh",
|
|
5
5
|
"manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
|
|
6
6
|
"manifest.charts.js": "sha384-gEAv/98+29RbhvNkiNWTNyBPbLTFr2Ld15wLu29FLCL57j1cwGChRrL9Pfk7dBtT",
|
|
@@ -9,32 +9,32 @@
|
|
|
9
9
|
"manifest.color.js": "sha384-6Rv3LxyTcZNjrhtayQfqRdCx0uSZ4BiEbgEI98I62eTvp8Aw7LBIoNJ0Je1oktwL",
|
|
10
10
|
"manifest.colorpicker.js": "sha384-BhcCe8cGcd0DTJNwzXWWY+FQNRfSFFl6XqfHIFP8yHg/aXFks1NIC6lVx0Sr1VkM",
|
|
11
11
|
"manifest.combobox.js": "sha384-MILTkrgsTzsYUjGo4ZuADqV85Xs4GmfB4xexfe9vbJMIoQTZ42W4zs+DTaVSPEsx",
|
|
12
|
-
"manifest.components.js": "sha384-
|
|
12
|
+
"manifest.components.js": "sha384-JalISaBBWNFl3ggx92Hb3B52EpwwG3gzgra6Q+js0OgZ8vrFKMD48CuBox2N9A5T",
|
|
13
13
|
"manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
|
|
14
|
-
"manifest.data.js": "sha384-
|
|
14
|
+
"manifest.data.js": "sha384-szQophuvtkatLyTtVALy63mbKPGQZQ/lP2v27QExQnS7HMuCbuhxgKdTITZQ1JQq",
|
|
15
15
|
"manifest.datepicker.js": "sha384-XnbeURni2X91ozVzatQcSjYYIS4MoW12dBRJnYAGBr0nCQ624heH5s+xtQSpLZX6",
|
|
16
|
-
"manifest.defer.js": "sha384-
|
|
16
|
+
"manifest.defer.js": "sha384-pMRGqQKiEoJhpUcD40QeM4jEHau7sz9Xn/YCpiUamT1T4xJBZDSiYX+xnVrSWoq+",
|
|
17
17
|
"manifest.device.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
|
|
18
|
-
"manifest.dropdowns.js": "sha384-
|
|
19
|
-
"manifest.edit.js": "sha384-
|
|
18
|
+
"manifest.dropdowns.js": "sha384-acufUps7R9WjqB4XXW5JLACqniuHJGM4CNTb2rF4B2Q/jv7ZRmsAwfr2McanOz3s",
|
|
19
|
+
"manifest.edit.js": "sha384-UsKV6oSwdF+yFtpZKr8KD62VajynYVsBcVN3+dAUI4nh2pOOf3/2lyybXbEG/pvT",
|
|
20
20
|
"manifest.export.js": "sha384-Rx6XvqBZc4apzP/FwcDr6yIln4/zNa08Q4ZqBZcEqUz1aNZQfl4h0+Ae7mqCQyuG",
|
|
21
21
|
"manifest.icons.js": "sha384-kKOINpX70YzNO3FvkV6umrmO3f0KIu0DNbwB+ej55a7y/lhU7v/myQtXL0bwCTbt",
|
|
22
22
|
"manifest.localization.js": "sha384-EImsIw8Z3l13V5eH9ZJF/yfsOfIvR1oPRNSArANkPji7V8O3IRf6zMwsNiAGj3Hk",
|
|
23
23
|
"manifest.markdown.js": "sha384-heyDR40LXHaAmAuA+fa381uFwShk1oAqpFFY6E2Qq4T3VN0TQfRqyc++MF40K5Hj",
|
|
24
24
|
"manifest.native.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
|
|
25
25
|
"manifest.payments.js": "sha384-8pofk2zhxtapPMpwnFyTelPMrYhShNhDCE722uQh/EYFvZFuPLmSdgunqsarVQjv",
|
|
26
|
-
"manifest.
|
|
26
|
+
"manifest.rich.text.js": "sha384-CBScTgPU6y96e481M7Ba1/YqPBkeQNLvMKpGc9LQLALOdyj8wlv7Faez+MXjT9yn",
|
|
27
|
+
"manifest.router.js": "sha384-QkKhRaCbdXEOxhj+ojT4jeLUCtQepBnqP+QWTIWdb6kUWD+mVzPN8hf6jhgschpW",
|
|
27
28
|
"manifest.slides.js": "sha384-3uRTkyK9XPLmnxI2+igZlpi4EyPlU/7IHj5j3BZJJ2KN455vXyk99fiXV3feO/XY",
|
|
28
29
|
"manifest.status.js": "sha384-MBO345ab7H6Uq1X2dZLt4Ge1Gcra+Z2qYApvlAeIV8CJhDDJrz2FPXpp+Kcp8zcM",
|
|
29
30
|
"manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
|
|
30
|
-
"manifest.sw.js": "sha384-
|
|
31
|
+
"manifest.sw.js": "sha384-FiEZfwCVI2lKcp4xaRE6nJhjGIbphg6BREeTGvRsIMpqqJ+5AzxFQKE1o84fGfGE",
|
|
31
32
|
"manifest.tabs.js": "sha384-OIIcyaQnGS0eNYk4zgAFEDboNYect7THvUd9D0V6nqCeDOxQcoiqLrBEmmWVTTet",
|
|
32
33
|
"manifest.tailwind.js": "sha384-r/Jvqb+Piz21jUts10BbVAJoKkShOdJRVFpywyi4HPIi/OfOJq5CtPyWAPbdkMgt",
|
|
33
|
-
"manifest.text.edit.js": "sha384-+VkMe/Ac9mhPu3YWhofY0Wxbm3rAFmdBd/z7oQW+Uu/Q1h5gFBIZ+Mx0ENseLq/o",
|
|
34
34
|
"manifest.toasts.js": "sha384-3zkWxzw693pxg3QDFsoYCA3CqYaLKmBaMArULXODD66Utolpewl0OAeTB92aWUVv",
|
|
35
35
|
"manifest.tooltips.js": "sha384-4b24PH5WsfFsewGea5SMWLwmrhC4kD6eDP/vvjNyjXYnQXXFGi4nLdojrIOwzG8M",
|
|
36
36
|
"manifest.url.parameters.js": "sha384-J2aSVBOPsoqsbafHndrWLHEDpKb4AKJAoQnVmKA4gZh5P/8HHjFWHO/lkusmG84l",
|
|
37
37
|
"manifest.utilities.js": "sha384-L5uXMLFBIF6LUM1haRjd4eGjHSWuqsCYSpPZRPYosNfJsMC5U5TnmjBxIhrZRe2d",
|
|
38
38
|
"manifest.virtual.js": "sha384-ZDNoF9QVhVcVpkjIK6NH15S6I5c6OBshiJpXSOYjNsIB+298I0a7g3aFO+jyq4Vb",
|
|
39
|
-
"manifest.js": "sha384-
|
|
39
|
+
"manifest.js": "sha384-G+ctciC90o/zSB/sRbmX7ANE/7rYvnepyzIsvNbD6N5ynlO5oludSDfzYVCdzU/g"
|
|
40
40
|
}
|
package/lib/manifest.js
CHANGED
|
@@ -276,7 +276,6 @@
|
|
|
276
276
|
'combobox',
|
|
277
277
|
'computed',
|
|
278
278
|
'tabs',
|
|
279
|
-
'text-edit',
|
|
280
279
|
'slides',
|
|
281
280
|
'colorpicker',
|
|
282
281
|
'datepicker',
|
|
@@ -303,11 +302,15 @@
|
|
|
303
302
|
'appwrite-presences'
|
|
304
303
|
];
|
|
305
304
|
|
|
305
|
+
// Loaded on use (x-rich-text / $rich), with data-plugins, or as a dependency
|
|
306
|
+
const USAGE_LOADED_PLUGINS = ['rich-text'];
|
|
307
|
+
|
|
306
308
|
// Plugin dependencies: plugins that require other plugins to be loaded first
|
|
307
309
|
const PLUGIN_DEPENDENCIES = {
|
|
308
310
|
'appwrite-data': ['data'],
|
|
309
311
|
'appwrite-presences': ['data', 'appwrite-auth'],
|
|
310
|
-
'device': ['utilities']
|
|
312
|
+
'device': ['utilities'],
|
|
313
|
+
'edit': ['rich-text']
|
|
311
314
|
};
|
|
312
315
|
|
|
313
316
|
// Derive default plugin list from manifest (only load data/localization/components when manifest needs them)
|
|
@@ -579,47 +582,132 @@
|
|
|
579
582
|
const USAGE_PLUGINS = [
|
|
580
583
|
{ magic: '$chat', plugin: 'chat' },
|
|
581
584
|
{ magic: '$presence', plugin: 'appwrite-presences' },
|
|
585
|
+
{ magic: '$rich', plugin: 'rich-text', attr: 'x-rich-text' },
|
|
582
586
|
...['$share', '$secure', '$links', '$push', '$app', '$haptics', '$biometric', '$camera'].map(magic => ({ magic, plugin: 'device' }))
|
|
583
|
-
];
|
|
587
|
+
].map(u => ({ ...u, re: new RegExp('\\' + u.magic + '\\b') }));
|
|
588
|
+
// $rich before Rich Text arrives (it loads on use, and SPA routes or component HTML can
|
|
589
|
+
// need it later): an idle stand-in, so expressions never throw. Rich Text bumps `v` when
|
|
590
|
+
// it registers the real magic, so effects that read $rich run again; Alpine binds magics
|
|
591
|
+
// when a directive is first evaluated, so the stand-in then delegates to the real one.
|
|
592
|
+
let richStubArmed = false;
|
|
593
|
+
function stubRichMagic() {
|
|
594
|
+
if (typeof window === 'undefined' || typeof document === 'undefined' || richStubArmed) return;
|
|
595
|
+
richStubArmed = true;
|
|
596
|
+
const install = () => {
|
|
597
|
+
const A = window.Alpine;
|
|
598
|
+
if (window.ManifestRichText || !A || !A.magic || !A.reactive || window.__manifestRichStub) return;
|
|
599
|
+
const state = window.__manifestRichStub = A.reactive({ v: 0 });
|
|
600
|
+
const idle = new Proxy({ value: '', link: '', selection: null, all: {}, active: () => false, can: () => false, markdown: () => '', html: () => '' },
|
|
601
|
+
{ get: (t, k) => k in t ? t[k] : (typeof k === 'string' ? () => { } : undefined), set: () => true });
|
|
602
|
+
A.magic('rich', (el, u) => { void state.v; return window.__manifestRichMagic ? window.__manifestRichMagic(el, u) : idle; });
|
|
603
|
+
};
|
|
604
|
+
document.addEventListener('alpine:init', install, { once: true });
|
|
605
|
+
if (window.Alpine && window.Alpine.magic) install();
|
|
606
|
+
}
|
|
607
|
+
stubRichMagic();
|
|
584
608
|
// Framework web components — <x-*> tags that are NOT project components.
|
|
585
609
|
const FRAMEWORK_TAG_RE = /^x-(code|code-group)$/;
|
|
586
|
-
function detectUsagePlugins(alreadyLoaded) {
|
|
610
|
+
function detectUsagePlugins(alreadyLoaded, root = typeof document === 'undefined' ? null : document) {
|
|
587
611
|
const wanted = USAGE_PLUGINS.filter(u => !alreadyLoaded.includes(u.plugin));
|
|
588
612
|
// <x-*> tags load the components plugin even with nothing registered in
|
|
589
613
|
// manifest.json (the loader's components/<name>.html convention).
|
|
590
614
|
const wantComponents = !alreadyLoaded.includes('components');
|
|
591
|
-
if ((wanted.length === 0 && !wantComponents) ||
|
|
615
|
+
if ((wanted.length === 0 && !wantComponents) || !root) return [];
|
|
592
616
|
const found = new Set();
|
|
593
|
-
const done = () => found.size === wanted.
|
|
617
|
+
const done = () => found.size === new Set(wanted.map(u => u.plugin)).size + (wantComponents ? 1 : 0);
|
|
594
618
|
|
|
595
|
-
for (const s of
|
|
619
|
+
for (const s of root.querySelectorAll('script:not([src])')) {
|
|
596
620
|
const t = s.textContent || '';
|
|
597
|
-
for (const u of wanted) if (!found.has(u.plugin) &&
|
|
621
|
+
for (const u of wanted) if (!found.has(u.plugin) && u.re.test(t)) found.add(u.plugin);
|
|
598
622
|
if (done()) return [...found];
|
|
599
623
|
}
|
|
600
624
|
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
for (const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
625
|
+
const check = (el) => {
|
|
626
|
+
if (wantComponents && !found.has('components')) {
|
|
627
|
+
const tag = el.tagName.toLowerCase();
|
|
628
|
+
if (tag.startsWith('x-') && !FRAMEWORK_TAG_RE.test(tag)) found.add('components');
|
|
629
|
+
}
|
|
630
|
+
for (const attr of el.attributes || []) {
|
|
631
|
+
for (const u of wanted) if (u.attr && !found.has(u.plugin) && attr.name.startsWith(u.attr)) found.add(u.plugin);
|
|
632
|
+
const v = attr.value;
|
|
633
|
+
if (!v || v.indexOf('$') === -1) continue;
|
|
634
|
+
for (const u of wanted) if (!found.has(u.plugin) && u.re.test(v)) found.add(u.plugin);
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
const scan = (node) => {
|
|
638
|
+
for (const el of node.querySelectorAll('*')) {
|
|
639
|
+
check(el);
|
|
640
|
+
if (done()) return;
|
|
613
641
|
if (el.tagName === 'TEMPLATE' && el.content) {
|
|
614
642
|
scan(el.content);
|
|
615
643
|
if (done()) return;
|
|
616
644
|
}
|
|
617
645
|
}
|
|
618
646
|
};
|
|
619
|
-
|
|
647
|
+
if (root.nodeType === 1) {
|
|
648
|
+
check(root);
|
|
649
|
+
if (root.tagName === 'TEMPLATE' && root.content) scan(root.content);
|
|
650
|
+
}
|
|
651
|
+
if (!done()) scan(root);
|
|
620
652
|
return [...found];
|
|
621
653
|
}
|
|
622
654
|
|
|
655
|
+
// Post-boot usage: component HTML, x-html and markdown content load the
|
|
656
|
+
// on-use plugins they reference. Derive path only, like the boot sniff.
|
|
657
|
+
let usageSniff = false;
|
|
658
|
+
// A failed on-use load is not retried within this page load
|
|
659
|
+
const usageFailed = new Set();
|
|
660
|
+
const usageLoaded = (p) => pluginLoads.has(p) || usageFailed.has(p);
|
|
661
|
+
function loadUsed(source, version = RESOLVED_VERSION) {
|
|
662
|
+
if (!usageSniff || !source || typeof document === 'undefined') return Promise.resolve([]);
|
|
663
|
+
let root = source;
|
|
664
|
+
if (typeof source === 'string') {
|
|
665
|
+
if (source.indexOf('x-') === -1 && source.indexOf('$') === -1) return Promise.resolve([]);
|
|
666
|
+
root = document.createElement('template');
|
|
667
|
+
root.innerHTML = source;
|
|
668
|
+
root = root.content;
|
|
669
|
+
}
|
|
670
|
+
const loaded = [...new Set(USAGE_PLUGINS.map(u => u.plugin))].filter(usageLoaded).concat('components');
|
|
671
|
+
const used = detectUsagePlugins(loaded, root);
|
|
672
|
+
if (!used.length) return Promise.resolve([]);
|
|
673
|
+
const list = resolveDependencies(used).filter(p => !usageLoaded(p));
|
|
674
|
+
return Promise.all(list.map(p => addScript(p, version).catch(error => {
|
|
675
|
+
if (usageFailed.has(p)) return;
|
|
676
|
+
usageFailed.add(p);
|
|
677
|
+
console.warn(`[Manifest Loader] Failed to load plugin ${p}:`, error);
|
|
678
|
+
}))).then(() => list);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
function watchUsage(version) {
|
|
682
|
+
if (typeof MutationObserver === 'undefined') return;
|
|
683
|
+
const pending = new Set();
|
|
684
|
+
let queued = false;
|
|
685
|
+
const allLoaded = () => USAGE_PLUGINS.every(u => usageLoaded(u.plugin));
|
|
686
|
+
const observer = new MutationObserver((records) => {
|
|
687
|
+
for (const r of records) for (const n of r.addedNodes) if (n.nodeType === 1) pending.add(n);
|
|
688
|
+
if (queued || !pending.size) return;
|
|
689
|
+
queued = true;
|
|
690
|
+
setTimeout(() => {
|
|
691
|
+
queued = false;
|
|
692
|
+
const nodes = [...pending].filter(n => n.isConnected);
|
|
693
|
+
pending.clear();
|
|
694
|
+
nodes.forEach(n => loadUsed(n, version));
|
|
695
|
+
if (allLoaded()) observer.disconnect();
|
|
696
|
+
}, 0);
|
|
697
|
+
});
|
|
698
|
+
observer.observe(document.documentElement, { childList: true, subtree: true });
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const RENAMED_PLUGINS = { 'text-edit': 'rich-text' };
|
|
702
|
+
function dropRenamed(list) {
|
|
703
|
+
return list.filter(p => {
|
|
704
|
+
const name = p.replace(/^\+/, '');
|
|
705
|
+
if (!RENAMED_PLUGINS[name]) return true;
|
|
706
|
+
console.warn(`[Manifest Loader] ${name} was renamed to ${RENAMED_PLUGINS[name]}`);
|
|
707
|
+
return false;
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
|
|
623
711
|
// Detect the device plugin (, , , …). Auto-loaded inside a
|
|
624
712
|
// Capacitor container, or when a `device` (formerly `native`) block opts in on the web.
|
|
625
713
|
function detectNativePlugins(manifest) {
|
|
@@ -662,7 +750,7 @@
|
|
|
662
750
|
let deriveFromManifest = !plugins;
|
|
663
751
|
|
|
664
752
|
if (plugins) {
|
|
665
|
-
const entries = plugins.split(',').map(p => p.trim()).filter(p => p);
|
|
753
|
+
const entries = dropRenamed(plugins.split(',').map(p => p.trim()).filter(p => p));
|
|
666
754
|
extraPlugins = entries.filter(p => p.startsWith('+')).map(p => p.slice(1));
|
|
667
755
|
const explicit = entries.filter(p => !p.startsWith('+'));
|
|
668
756
|
if (explicit.length > 0) {
|
|
@@ -740,9 +828,10 @@
|
|
|
740
828
|
// browser engine (lib/manifest.tailwind.js) — but the utilities plugin's
|
|
741
829
|
// uncovered-class watcher lazily loads it this way (see
|
|
742
830
|
// manifest.utilities.static.js setupUncoveredClassWatcher).
|
|
743
|
-
const allPlugins = [...AVAILABLE_PLUGINS, ...APPWRITE_PLUGINS, ...AUTHORING_PLUGINS, 'payments', 'chat', 'device', 'native', 'import', 'tailwind'];
|
|
831
|
+
const allPlugins = [...AVAILABLE_PLUGINS, ...USAGE_LOADED_PLUGINS, ...APPWRITE_PLUGINS, ...AUTHORING_PLUGINS, 'payments', 'chat', 'device', 'native', 'import', 'tailwind'];
|
|
744
832
|
if (!allPlugins.includes(pluginName)) {
|
|
745
|
-
|
|
833
|
+
if (RENAMED_PLUGINS[pluginName]) dropRenamed([pluginName]);
|
|
834
|
+
else console.warn(`[Manifest Loader] Unknown plugin: ${pluginName}`);
|
|
746
835
|
return Promise.reject(new Error(`Unknown plugin: ${pluginName}`));
|
|
747
836
|
}
|
|
748
837
|
|
|
@@ -753,7 +842,9 @@
|
|
|
753
842
|
return Promise.all(pluginList.map(plugin => addScript(plugin, version)));
|
|
754
843
|
},
|
|
755
844
|
loadTailwind: loadTailwind,
|
|
756
|
-
getPluginUrl: getPluginUrl
|
|
845
|
+
getPluginUrl: getPluginUrl,
|
|
846
|
+
// On-use plugins referenced by an HTML string or element
|
|
847
|
+
loadUsed: loadUsed
|
|
757
848
|
};
|
|
758
849
|
|
|
759
850
|
// ---- App-shell service worker (PERF-PRIMITIVES-DESIGN §13) ----
|
|
@@ -1003,10 +1094,13 @@
|
|
|
1003
1094
|
if (used.length > 0) {
|
|
1004
1095
|
const late = resolveDependencies(used).filter(p => !pluginsToLoad.includes(p));
|
|
1005
1096
|
await Promise.all(late.map(p => addScript(p, config.version).catch(error => {
|
|
1097
|
+
usageFailed.add(p);
|
|
1006
1098
|
console.warn(`[Manifest Loader] Failed to load plugin ${p}:`, error);
|
|
1007
1099
|
})));
|
|
1008
1100
|
}
|
|
1009
1101
|
} catch (_) { /* sniffing must never block Alpine */ }
|
|
1102
|
+
usageSniff = true;
|
|
1103
|
+
watchUsage(config.version);
|
|
1010
1104
|
}
|
|
1011
1105
|
startReadyCoordinator(pluginsToLoad, config.tailwind);
|
|
1012
1106
|
loadAlpine(alpineUrlCandidates(config.alpine));
|