mnfst 0.5.231 → 0.5.233
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 +172 -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 +2396 -1082
- package/lib/manifest.integrity.json +10 -10
- package/lib/manifest.js +160 -25
- package/lib/manifest.min.css +1 -1
- package/lib/manifest.rich.text.css +253 -0
- package/lib/manifest.rich.text.js +3231 -0
- 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
- package/lib/manifest.text.edit.js +0 -2431
|
@@ -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-ovIuPS7AiQP/dP+NHcF9QaB3YK3dlqOLWN9pYX/RHofc2PLrZZuDjfEFiyNReuBu",
|
|
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-cemls8IyDcg61WdlIOT60HmQS7aCef4ifwqnXfw7kA6Jp5D2PdXazWRRzR6QHx10",
|
|
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-bOvEFgjau1t30LPHKBGkcJ3jH8tRUy1k8qpyYs8GbB6gUJ/R9JQCzeaF5fsKlzu3",
|
|
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-QpPHG4uWjJSJoTPY8yOtoIFoVmHbuYPhtghBU0gc2l0PJBc25cNPuNcD4+55Qv3i",
|
|
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-vXYxaf8oKd2LT8C9xRmFmEXhh0qDLv0set07o/hI4hkOvpS+CTDdC5UNECLRrSWa",
|
|
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-m5WiqHv+23ZnBvvIt9NtUGE2Gupaw9jDpKuonIH9HZCHc+LR8wbitDImJoNPH9CI"
|
|
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,173 @@
|
|
|
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
|
+
// Writes ($rich.value = …, $rich.all = …) are kept per element and applied to its field at handover
|
|
601
|
+
const writes = window.__manifestRichStubWrites = [], perEl = new WeakMap();
|
|
602
|
+
const deref = (r) => r && typeof r.deref === 'function' ? r.deref() : r;
|
|
603
|
+
const base = { value: '', link: '', selection: null, all: {}, active: () => false, can: () => false, markdown: () => '', html: () => '' };
|
|
604
|
+
const idleFor = (el) => {
|
|
605
|
+
if (!perEl.has(el)) perEl.set(el, new Proxy(base, {
|
|
606
|
+
get: (t, k) => { const w = writes.find(x => deref(x[0]) === el && x[1] === k); return w ? w[2] : k in t ? t[k] : (typeof k === 'string' ? () => { } : undefined); },
|
|
607
|
+
// The latest write per element and key; elements gone from the page are let go
|
|
608
|
+
set: (t, k, v) => {
|
|
609
|
+
for (let i = writes.length - 1; i >= 0; i--) { const e = deref(writes[i][0]); if (!e || !e.isConnected || (e === el && writes[i][1] === k)) writes.splice(i, 1); }
|
|
610
|
+
writes.push([typeof WeakRef === 'function' ? new WeakRef(el) : el, k, v]);
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
}));
|
|
614
|
+
return perEl.get(el);
|
|
615
|
+
};
|
|
616
|
+
A.magic('rich', (el, u) => { void state.v; return window.__manifestRichMagic ? window.__manifestRichMagic(el, u) : idleFor(el); });
|
|
617
|
+
};
|
|
618
|
+
document.addEventListener('alpine:init', install, { once: true });
|
|
619
|
+
if (window.Alpine && window.Alpine.magic) install();
|
|
620
|
+
}
|
|
621
|
+
stubRichMagic();
|
|
622
|
+
// $edit likewise: Edit loads behind a gate (data-plugins or Manifest.loadPlugin('edit')), so until
|
|
623
|
+
// it registers, $edit is an idle stand-in; Edit bumps `v` and the stand-in delegates to it.
|
|
624
|
+
let editStubArmed = false;
|
|
625
|
+
function stubEditMagic() {
|
|
626
|
+
if (typeof window === 'undefined' || typeof document === 'undefined' || editStubArmed) return;
|
|
627
|
+
editStubArmed = true;
|
|
628
|
+
const install = () => {
|
|
629
|
+
const A = window.Alpine;
|
|
630
|
+
if (window.__manifestEditMagic || !A || !A.magic || !A.reactive || window.__manifestEditStub) return;
|
|
631
|
+
const state = window.__manifestEditStub = A.reactive({ v: 0 });
|
|
632
|
+
const none = () => false;
|
|
633
|
+
// Writes ($edit.onPublish = …) are kept and applied to the store at handover
|
|
634
|
+
const writes = window.__manifestEditStubWrites = {};
|
|
635
|
+
const idle = new Proxy({
|
|
636
|
+
active: false, canUndo: false, canRedo: false, version: 0, stale: [], conflicts: [], onPublish: null, target: null,
|
|
637
|
+
can: none, scope: () => null, block: () => null, patches: () => [], export: () => ({ log: [], cursor: 0 }),
|
|
638
|
+
publish: () => Promise.resolve({ results: [] }), undo: () => Promise.resolve(false), redo: () => Promise.resolve(false),
|
|
639
|
+
classes: new Proxy({}, { get: () => none })
|
|
640
|
+
}, { get: (t, k) => k in writes ? writes[k] : k in t ? t[k] : (typeof k === 'string' ? none : undefined), set: (t, k, v) => { writes[k] = v; return true; } });
|
|
641
|
+
A.magic('edit', (el, u) => { void state.v; return window.__manifestEditMagic ? window.__manifestEditMagic(el, u) : idle; });
|
|
642
|
+
};
|
|
643
|
+
document.addEventListener('alpine:init', install, { once: true });
|
|
644
|
+
if (window.Alpine && window.Alpine.magic) install();
|
|
645
|
+
}
|
|
646
|
+
stubEditMagic();
|
|
647
|
+
// Plugins loaded after Alpine started adopt what its first walk already passed
|
|
648
|
+
if (typeof document !== 'undefined') document.addEventListener('alpine:initialized', () => { window.__manifestAlpineStarted = true; }, { once: true });
|
|
584
649
|
// Framework web components — <x-*> tags that are NOT project components.
|
|
585
650
|
const FRAMEWORK_TAG_RE = /^x-(code|code-group)$/;
|
|
586
|
-
function detectUsagePlugins(alreadyLoaded) {
|
|
651
|
+
function detectUsagePlugins(alreadyLoaded, root = typeof document === 'undefined' ? null : document) {
|
|
587
652
|
const wanted = USAGE_PLUGINS.filter(u => !alreadyLoaded.includes(u.plugin));
|
|
588
653
|
// <x-*> tags load the components plugin even with nothing registered in
|
|
589
654
|
// manifest.json (the loader's components/<name>.html convention).
|
|
590
655
|
const wantComponents = !alreadyLoaded.includes('components');
|
|
591
|
-
if ((wanted.length === 0 && !wantComponents) ||
|
|
656
|
+
if ((wanted.length === 0 && !wantComponents) || !root) return [];
|
|
592
657
|
const found = new Set();
|
|
593
|
-
const done = () => found.size === wanted.
|
|
658
|
+
const done = () => found.size === new Set(wanted.map(u => u.plugin)).size + (wantComponents ? 1 : 0);
|
|
594
659
|
|
|
595
|
-
for (const s of
|
|
660
|
+
for (const s of root.querySelectorAll('script:not([src])')) {
|
|
596
661
|
const t = s.textContent || '';
|
|
597
|
-
for (const u of wanted) if (!found.has(u.plugin) &&
|
|
662
|
+
for (const u of wanted) if (!found.has(u.plugin) && u.re.test(t)) found.add(u.plugin);
|
|
598
663
|
if (done()) return [...found];
|
|
599
664
|
}
|
|
600
665
|
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
for (const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
666
|
+
const check = (el) => {
|
|
667
|
+
if (wantComponents && !found.has('components')) {
|
|
668
|
+
const tag = el.tagName.toLowerCase();
|
|
669
|
+
if (tag.startsWith('x-') && !FRAMEWORK_TAG_RE.test(tag)) found.add('components');
|
|
670
|
+
}
|
|
671
|
+
for (const attr of el.attributes || []) {
|
|
672
|
+
for (const u of wanted) if (u.attr && !found.has(u.plugin) && attr.name.startsWith(u.attr)) found.add(u.plugin);
|
|
673
|
+
const v = attr.value;
|
|
674
|
+
if (!v || v.indexOf('$') === -1) continue;
|
|
675
|
+
for (const u of wanted) if (!found.has(u.plugin) && u.re.test(v)) found.add(u.plugin);
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
const scan = (node) => {
|
|
679
|
+
for (const el of node.querySelectorAll('*')) {
|
|
680
|
+
check(el);
|
|
681
|
+
if (done()) return;
|
|
613
682
|
if (el.tagName === 'TEMPLATE' && el.content) {
|
|
614
683
|
scan(el.content);
|
|
615
684
|
if (done()) return;
|
|
616
685
|
}
|
|
617
686
|
}
|
|
618
687
|
};
|
|
619
|
-
|
|
688
|
+
if (root.nodeType === 1) {
|
|
689
|
+
check(root);
|
|
690
|
+
if (root.tagName === 'TEMPLATE' && root.content) scan(root.content);
|
|
691
|
+
}
|
|
692
|
+
if (!done()) scan(root);
|
|
620
693
|
return [...found];
|
|
621
694
|
}
|
|
622
695
|
|
|
696
|
+
// Post-boot usage: component HTML, x-html and markdown content load the
|
|
697
|
+
// on-use plugins they reference. Derive path only, like the boot sniff.
|
|
698
|
+
let usageSniff = false;
|
|
699
|
+
// A failed on-use load is not retried within this page load
|
|
700
|
+
const usageFailed = new Set();
|
|
701
|
+
const usageLoaded = (p) => pluginLoads.has(p) || usageFailed.has(p);
|
|
702
|
+
function loadUsed(source, version = RESOLVED_VERSION) {
|
|
703
|
+
if (!usageSniff || !source || typeof document === 'undefined') return Promise.resolve([]);
|
|
704
|
+
let root = source;
|
|
705
|
+
if (typeof source === 'string') {
|
|
706
|
+
if (source.indexOf('x-') === -1 && source.indexOf('$') === -1) return Promise.resolve([]);
|
|
707
|
+
root = document.createElement('template');
|
|
708
|
+
root.innerHTML = source;
|
|
709
|
+
root = root.content;
|
|
710
|
+
}
|
|
711
|
+
const loaded = [...new Set(USAGE_PLUGINS.map(u => u.plugin))].filter(usageLoaded).concat('components');
|
|
712
|
+
const used = detectUsagePlugins(loaded, root);
|
|
713
|
+
if (!used.length) return Promise.resolve([]);
|
|
714
|
+
const list = resolveDependencies(used).filter(p => !usageLoaded(p));
|
|
715
|
+
return Promise.all(list.map(p => addScript(p, version).catch(error => {
|
|
716
|
+
if (usageFailed.has(p)) return;
|
|
717
|
+
usageFailed.add(p);
|
|
718
|
+
console.warn(`[Manifest Loader] Failed to load plugin ${p}:`, error);
|
|
719
|
+
}))).then(() => list);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
function watchUsage(version) {
|
|
723
|
+
if (typeof MutationObserver === 'undefined') return;
|
|
724
|
+
const pending = new Set();
|
|
725
|
+
let queued = false;
|
|
726
|
+
const allLoaded = () => USAGE_PLUGINS.every(u => usageLoaded(u.plugin));
|
|
727
|
+
const observer = new MutationObserver((records) => {
|
|
728
|
+
for (const r of records) for (const n of r.addedNodes) if (n.nodeType === 1) pending.add(n);
|
|
729
|
+
if (queued || !pending.size) return;
|
|
730
|
+
queued = true;
|
|
731
|
+
setTimeout(() => {
|
|
732
|
+
queued = false;
|
|
733
|
+
const nodes = [...pending].filter(n => n.isConnected);
|
|
734
|
+
pending.clear();
|
|
735
|
+
nodes.forEach(n => loadUsed(n, version));
|
|
736
|
+
if (allLoaded()) observer.disconnect();
|
|
737
|
+
}, 0);
|
|
738
|
+
});
|
|
739
|
+
observer.observe(document.documentElement, { childList: true, subtree: true });
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
const RENAMED_PLUGINS = { 'text-edit': 'rich-text' };
|
|
743
|
+
function dropRenamed(list) {
|
|
744
|
+
return list.filter(p => {
|
|
745
|
+
const name = p.replace(/^\+/, '');
|
|
746
|
+
if (!RENAMED_PLUGINS[name]) return true;
|
|
747
|
+
console.warn(`[Manifest Loader] ${name} was renamed to ${RENAMED_PLUGINS[name]}`);
|
|
748
|
+
return false;
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
|
|
623
752
|
// Detect the device plugin (, , , …). Auto-loaded inside a
|
|
624
753
|
// Capacitor container, or when a `device` (formerly `native`) block opts in on the web.
|
|
625
754
|
function detectNativePlugins(manifest) {
|
|
@@ -662,7 +791,7 @@
|
|
|
662
791
|
let deriveFromManifest = !plugins;
|
|
663
792
|
|
|
664
793
|
if (plugins) {
|
|
665
|
-
const entries = plugins.split(',').map(p => p.trim()).filter(p => p);
|
|
794
|
+
const entries = dropRenamed(plugins.split(',').map(p => p.trim()).filter(p => p));
|
|
666
795
|
extraPlugins = entries.filter(p => p.startsWith('+')).map(p => p.slice(1));
|
|
667
796
|
const explicit = entries.filter(p => !p.startsWith('+'));
|
|
668
797
|
if (explicit.length > 0) {
|
|
@@ -740,9 +869,10 @@
|
|
|
740
869
|
// browser engine (lib/manifest.tailwind.js) — but the utilities plugin's
|
|
741
870
|
// uncovered-class watcher lazily loads it this way (see
|
|
742
871
|
// manifest.utilities.static.js setupUncoveredClassWatcher).
|
|
743
|
-
const allPlugins = [...AVAILABLE_PLUGINS, ...APPWRITE_PLUGINS, ...AUTHORING_PLUGINS, 'payments', 'chat', 'device', 'native', 'import', 'tailwind'];
|
|
872
|
+
const allPlugins = [...AVAILABLE_PLUGINS, ...USAGE_LOADED_PLUGINS, ...APPWRITE_PLUGINS, ...AUTHORING_PLUGINS, 'payments', 'chat', 'device', 'native', 'import', 'tailwind'];
|
|
744
873
|
if (!allPlugins.includes(pluginName)) {
|
|
745
|
-
|
|
874
|
+
if (RENAMED_PLUGINS[pluginName]) dropRenamed([pluginName]);
|
|
875
|
+
else console.warn(`[Manifest Loader] Unknown plugin: ${pluginName}`);
|
|
746
876
|
return Promise.reject(new Error(`Unknown plugin: ${pluginName}`));
|
|
747
877
|
}
|
|
748
878
|
|
|
@@ -753,7 +883,9 @@
|
|
|
753
883
|
return Promise.all(pluginList.map(plugin => addScript(plugin, version)));
|
|
754
884
|
},
|
|
755
885
|
loadTailwind: loadTailwind,
|
|
756
|
-
getPluginUrl: getPluginUrl
|
|
886
|
+
getPluginUrl: getPluginUrl,
|
|
887
|
+
// On-use plugins referenced by an HTML string or element
|
|
888
|
+
loadUsed: loadUsed
|
|
757
889
|
};
|
|
758
890
|
|
|
759
891
|
// ---- App-shell service worker (PERF-PRIMITIVES-DESIGN §13) ----
|
|
@@ -1003,10 +1135,13 @@
|
|
|
1003
1135
|
if (used.length > 0) {
|
|
1004
1136
|
const late = resolveDependencies(used).filter(p => !pluginsToLoad.includes(p));
|
|
1005
1137
|
await Promise.all(late.map(p => addScript(p, config.version).catch(error => {
|
|
1138
|
+
usageFailed.add(p);
|
|
1006
1139
|
console.warn(`[Manifest Loader] Failed to load plugin ${p}:`, error);
|
|
1007
1140
|
})));
|
|
1008
1141
|
}
|
|
1009
1142
|
} catch (_) { /* sniffing must never block Alpine */ }
|
|
1143
|
+
usageSniff = true;
|
|
1144
|
+
watchUsage(config.version);
|
|
1010
1145
|
}
|
|
1011
1146
|
startReadyCoordinator(pluginsToLoad, config.tailwind);
|
|
1012
1147
|
loadAlpine(alpineUrlCandidates(config.alpine));
|