@tanqory/theme-conformance 0.1.0-alpha.16 → 0.1.0-alpha.17
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 +26 -1
- package/dist/browser/harness.d.ts +8 -1
- package/dist/browser/harness.js +8 -2
- package/dist/browser/harness.js.map +1 -1
- package/dist/browser/page-run.d.ts +29 -1
- package/dist/browser/page-run.js +54 -6
- package/dist/browser/page-run.js.map +1 -1
- package/dist/browser/rules.d.ts +70 -0
- package/dist/browser/rules.js +119 -6
- package/dist/browser/rules.js.map +1 -1
- package/dist/build-info.json +1 -1
- package/dist/cli.js +52 -1
- package/dist/cli.js.map +1 -1
- package/dist/client-chunks.d.ts +185 -0
- package/dist/client-chunks.js +378 -0
- package/dist/client-chunks.js.map +1 -0
- package/dist/field-types.js +6 -5
- package/dist/field-types.js.map +1 -1
- package/dist/fixtures/store-fixture.d.ts +5 -0
- package/dist/fixtures/store-fixture.js.map +1 -1
- package/dist/fixtures/stores/alpha.json +38 -0
- package/dist/fixtures/stores/beta.json +3 -0
- package/dist/html-checks.d.ts +3 -0
- package/dist/html-checks.js +15 -0
- package/dist/html-checks.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +67 -1
- package/dist/jobs.js +155 -6
- package/dist/jobs.js.map +1 -1
- package/dist/review/config.d.ts +36 -0
- package/dist/review/config.js +70 -0
- package/dist/review/config.js.map +1 -0
- package/dist/review/index.d.ts +85 -0
- package/dist/review/index.js +308 -0
- package/dist/review/index.js.map +1 -0
- package/dist/review/lighthouse.d.ts +27 -0
- package/dist/review/lighthouse.js +94 -0
- package/dist/review/lighthouse.js.map +1 -0
- package/dist/review/stores.d.ts +42 -0
- package/dist/review/stores.js +109 -0
- package/dist/review/stores.js.map +1 -0
- package/dist/runner-identity.d.ts +1 -1
- package/dist/runner-identity.js +6 -5
- package/dist/runner-identity.js.map +1 -1
- package/dist/storefront/budgets.js +26 -4
- package/dist/storefront/budgets.js.map +1 -1
- package/dist/storefront/checks/i18n.js +39 -0
- package/dist/storefront/checks/i18n.js.map +1 -1
- package/dist/storefront/fixture.d.ts +4 -3
- package/dist/storefront/fixture.js +12 -7
- package/dist/storefront/fixture.js.map +1 -1
- package/dist/storefront/gateway.d.ts +18 -2
- package/dist/storefront/gateway.js +47 -13
- package/dist/storefront/gateway.js.map +1 -1
- package/dist/storefront/locale-names.d.ts +39 -0
- package/dist/storefront/locale-names.js +63 -0
- package/dist/storefront/locale-names.js.map +1 -0
- package/dist/suites/app-blocks.d.ts +13 -0
- package/dist/suites/app-blocks.js +172 -0
- package/dist/suites/app-blocks.js.map +1 -0
- package/dist/suites/s1-static.js +4 -2
- package/dist/suites/s1-static.js.map +1 -1
- package/dist/suites/s2-render.js +20 -2
- package/dist/suites/s2-render.js.map +1 -1
- package/dist/suites/s4-limits.js +44 -1
- package/dist/suites/s4-limits.js.map +1 -1
- package/dist/suites/s5-hydration.d.ts +2 -0
- package/dist/suites/s5-hydration.js +89 -12
- package/dist/suites/s5-hydration.js.map +1 -1
- package/dist/workerd/config.js +3 -0
- package/dist/workerd/config.js.map +1 -1
- package/dist/workerd/shim.mjs +40 -3
- package/dist/workerd/storefront-data.mjs +25 -11
- package/dist/workerd/tanqory-money.generated.mjs +551 -0
- package/docs/storefront-tier.md +1 -0
- package/fixtures/chunks-pass/client/assets/boot-d9c77977.js +13 -0
- package/fixtures/chunks-pass/client/assets/core-9e704970.js +21 -0
- package/fixtures/chunks-pass/client/assets/hero-f2dd1270.js +3 -0
- package/fixtures/chunks-pass/client/assets/main-28182e68.css +1 -0
- package/fixtures/chunks-pass/client/assets/main-3401d1c6.js +22 -0
- package/fixtures/chunks-pass/client/assets/probe-bad-de7c494b.js +1 -0
- package/fixtures/chunks-pass/client/assets/probe-ok-e658f0b4.js +1 -0
- package/fixtures/chunks-pass/client/assets/shared-53e84b49.js +2 -0
- package/fixtures/chunks-pass/client/client-manifest.json +87 -0
- package/fixtures/chunks-pass/defaults/regions/header.json +1 -0
- package/fixtures/chunks-pass/defaults/settings.json +1 -0
- package/fixtures/chunks-pass/defaults/templates/index.json +1 -0
- package/fixtures/chunks-pass/defaults/templates/product.json +1 -0
- package/fixtures/chunks-pass/locales/en.json +1 -0
- package/fixtures/chunks-pass/manifest.json +1 -0
- package/fixtures/chunks-pass/server/entry.mjs +171 -0
- package/fixtures/hydration-pass/defaults/templates/product.json +1 -0
- package/fixtures/hydration-pass/manifest.json +1 -1
- package/fixtures/hydration-pass/server/entry.mjs +7 -1
- package/fixtures/hydration-violations/slot-server-children/server/entry.mjs +7 -1
- package/fixtures/invalid-url-setting/defaults/templates/product.json +1 -0
- package/fixtures/invalid-url-setting/manifest.json +1 -1
- package/fixtures/invalid-url-setting/server/entry.mjs +7 -1
- package/fixtures/minimal-pass/defaults/templates/product.json +1 -0
- package/fixtures/minimal-pass/manifest.json +1 -1
- package/fixtures/minimal-pass/server/entry.mjs +7 -1
- package/fixtures/violations/defaults/templates/product.json +1 -0
- package/fixtures/violations/entries/async-iterable-body.mjs +7 -1
- package/fixtures/violations/entries/browser-only-capability.mjs +7 -1
- package/fixtures/violations/entries/deferred-ambient-access.mjs +7 -1
- package/fixtures/violations/entries/depends-on-harness-scope.mjs +7 -1
- package/fixtures/violations/entries/fetch-without-network.mjs +7 -1
- package/fixtures/violations/entries/forges-array-push.mjs +7 -1
- package/fixtures/violations/entries/forges-json-stringify.mjs +7 -1
- package/fixtures/violations/entries/forges-object-then.mjs +7 -1
- package/fixtures/violations/entries/forges-to-json.mjs +7 -1
- package/fixtures/violations/entries/grants-own-capability.mjs +7 -1
- package/fixtures/violations/entries/lowercase-tenant-leak.mjs +7 -1
- package/fixtures/violations/entries/nondeterministic-output.mjs +7 -1
- package/fixtures/violations/entries/reads-date-now.mjs +7 -1
- package/fixtures/violations/entries/reads-new-date.mjs +7 -1
- package/fixtures/violations/entries/redefines-prototype-method.mjs +7 -1
- package/fixtures/violations/entries/renders-tq-csrf-field.mjs +7 -1
- package/fixtures/violations/entries/renders-tq-form-field.mjs +7 -1
- package/fixtures/violations/entries/response-too-large.mjs +7 -1
- package/fixtures/violations/entries/retains-tenant-state.mjs +7 -1
- package/fixtures/violations/entries/signed-in-actions-customer.mjs +7 -1
- package/fixtures/violations/entries/signed-in-harness-scope.mjs +7 -1
- package/fixtures/violations/entries/slow-cold-render.mjs +7 -1
- package/fixtures/violations/entries/slow-signed-in-render.mjs +7 -1
- package/fixtures/violations/entries/slow-store-b-render.mjs +7 -1
- package/fixtures/violations/entries/stashes-on-date-prototype.mjs +7 -1
- package/fixtures/violations/entries/stashes-on-json.mjs +7 -1
- package/fixtures/violations/entries/stashes-on-prototype.mjs +7 -1
- package/fixtures/violations/entries/swallows-data-limit.mjs +7 -1
- package/fixtures/violations/manifest.json +1 -1
- package/package.json +7 -14
- package/review-config.json +37 -0
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -62,6 +63,11 @@ Array.prototype.map = function map(fn, self) {
|
|
|
62
63
|
|
|
63
64
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
64
65
|
|
|
66
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
67
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
68
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
69
|
+
|
|
70
|
+
|
|
65
71
|
function renderSection(node, snap) {
|
|
66
72
|
switch (node.type) {
|
|
67
73
|
case 'header-bar': {
|
|
@@ -72,7 +78,7 @@ function renderSection(node, snap) {
|
|
|
72
78
|
case 'hero':
|
|
73
79
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
74
80
|
case 'rich-text':
|
|
75
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
81
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
76
82
|
default:
|
|
77
83
|
return ''
|
|
78
84
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -60,6 +61,11 @@ JSON.stringify = function stringify(value, replacer, space) {
|
|
|
60
61
|
|
|
61
62
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
62
63
|
|
|
64
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
65
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
66
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
67
|
+
|
|
68
|
+
|
|
63
69
|
function renderSection(node, snap) {
|
|
64
70
|
switch (node.type) {
|
|
65
71
|
case 'header-bar': {
|
|
@@ -70,7 +76,7 @@ function renderSection(node, snap) {
|
|
|
70
76
|
case 'hero':
|
|
71
77
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
72
78
|
case 'rich-text':
|
|
73
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
79
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
74
80
|
default:
|
|
75
81
|
return ''
|
|
76
82
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -78,6 +79,11 @@ Object.defineProperty(Object.prototype, 'then', {
|
|
|
78
79
|
|
|
79
80
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
80
81
|
|
|
82
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
83
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
84
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
85
|
+
|
|
86
|
+
|
|
81
87
|
function renderSection(node, snap) {
|
|
82
88
|
switch (node.type) {
|
|
83
89
|
case 'header-bar': {
|
|
@@ -88,7 +94,7 @@ function renderSection(node, snap) {
|
|
|
88
94
|
case 'hero':
|
|
89
95
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
90
96
|
case 'rich-text':
|
|
91
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
97
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
92
98
|
default:
|
|
93
99
|
return ''
|
|
94
100
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -62,6 +63,11 @@ Object.defineProperty(Object.prototype, 'toJSON', {
|
|
|
62
63
|
|
|
63
64
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
64
65
|
|
|
66
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
67
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
68
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
69
|
+
|
|
70
|
+
|
|
65
71
|
function renderSection(node, snap) {
|
|
66
72
|
switch (node.type) {
|
|
67
73
|
case 'header-bar': {
|
|
@@ -72,7 +78,7 @@ function renderSection(node, snap) {
|
|
|
72
78
|
case 'hero':
|
|
73
79
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
74
80
|
case 'rich-text':
|
|
75
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
81
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
76
82
|
default:
|
|
77
83
|
return ''
|
|
78
84
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -54,6 +55,11 @@ const __trim = String.prototype.trim
|
|
|
54
55
|
|
|
55
56
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
56
57
|
|
|
58
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
59
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
60
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
61
|
+
|
|
62
|
+
|
|
57
63
|
function renderSection(node, snap) {
|
|
58
64
|
switch (node.type) {
|
|
59
65
|
case 'header-bar': {
|
|
@@ -64,7 +70,7 @@ function renderSection(node, snap) {
|
|
|
64
70
|
case 'hero':
|
|
65
71
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
66
72
|
case 'rich-text':
|
|
67
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
73
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
68
74
|
default:
|
|
69
75
|
return ''
|
|
70
76
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|
|
@@ -45,6 +45,7 @@ export const manifest = {
|
|
|
45
45
|
title: 'Rich text',
|
|
46
46
|
regions: ['main'],
|
|
47
47
|
attributes: { body: { type: 'richtext', label: 'Body' } },
|
|
48
|
+
children: ['@app'],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
settingsSchema: [{ group: 'Colors', items: [{ key: 'colorScheme', type: 'select', label: 'Scheme', options: [{ value: 'light', label: 'Light' }, { value: 'dark', label: 'Dark' }], default: 'light' }] }],
|
|
@@ -52,6 +53,11 @@ export const manifest = {
|
|
|
52
53
|
|
|
53
54
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])
|
|
54
55
|
|
|
56
|
+
// theme-abi §7.2 AppBlocks-1: a block of an installed app renders as the platform placeholder, its settings inert JSON
|
|
57
|
+
const appJson = (v) => JSON.stringify(v ?? {}).replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026')
|
|
58
|
+
const appBlocks = (node) => (node.blocks ?? []).filter((b) => /^app:/.test(b.type)).map((b) => `<div data-tq-app-block="${esc(b.type)}" data-tq-node="${esc(b.id)}" data-tq-type="${esc(b.type)}" class="tq-app-block"><script type="application/json">${appJson(b.settings)}</script></div>`).join('')
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
function renderSection(node, snap) {
|
|
56
62
|
switch (node.type) {
|
|
57
63
|
case 'header-bar': {
|
|
@@ -62,7 +68,7 @@ function renderSection(node, snap) {
|
|
|
62
68
|
case 'hero':
|
|
63
69
|
return `<section data-tq-node="${esc(node.id)}"><h1>${esc(node.settings?.heading ?? 'Welcome')}</h1>${node.settings?.body ?? ''}</section>`
|
|
64
70
|
case 'rich-text':
|
|
65
|
-
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}</section>`
|
|
71
|
+
return `<section data-tq-node="${esc(node.id)}">${node.settings?.body ?? ''}${appBlocks(node)}</section>`
|
|
66
72
|
default:
|
|
67
73
|
return ''
|
|
68
74
|
}
|