@tanqory/theme-conformance 0.1.0-alpha.15 → 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.
Files changed (140) hide show
  1. package/README.md +27 -2
  2. package/dist/browser/harness.d.ts +8 -1
  3. package/dist/browser/harness.js +8 -2
  4. package/dist/browser/harness.js.map +1 -1
  5. package/dist/browser/page-run.d.ts +29 -1
  6. package/dist/browser/page-run.js +54 -6
  7. package/dist/browser/page-run.js.map +1 -1
  8. package/dist/browser/rules.d.ts +70 -0
  9. package/dist/browser/rules.js +119 -6
  10. package/dist/browser/rules.js.map +1 -1
  11. package/dist/build-info.json +1 -1
  12. package/dist/cli.js +52 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/client-chunks.d.ts +185 -0
  15. package/dist/client-chunks.js +378 -0
  16. package/dist/client-chunks.js.map +1 -0
  17. package/dist/field-types.js +6 -5
  18. package/dist/field-types.js.map +1 -1
  19. package/dist/fixtures/store-fixture.d.ts +5 -0
  20. package/dist/fixtures/store-fixture.js.map +1 -1
  21. package/dist/fixtures/stores/alpha.json +38 -0
  22. package/dist/fixtures/stores/beta.json +3 -0
  23. package/dist/html-checks.d.ts +3 -0
  24. package/dist/html-checks.js +15 -0
  25. package/dist/html-checks.js.map +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +1 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/jobs.d.ts +67 -1
  30. package/dist/jobs.js +155 -6
  31. package/dist/jobs.js.map +1 -1
  32. package/dist/review/config.d.ts +36 -0
  33. package/dist/review/config.js +70 -0
  34. package/dist/review/config.js.map +1 -0
  35. package/dist/review/index.d.ts +85 -0
  36. package/dist/review/index.js +308 -0
  37. package/dist/review/index.js.map +1 -0
  38. package/dist/review/lighthouse.d.ts +27 -0
  39. package/dist/review/lighthouse.js +94 -0
  40. package/dist/review/lighthouse.js.map +1 -0
  41. package/dist/review/stores.d.ts +42 -0
  42. package/dist/review/stores.js +109 -0
  43. package/dist/review/stores.js.map +1 -0
  44. package/dist/runner-identity.d.ts +1 -1
  45. package/dist/runner-identity.js +6 -5
  46. package/dist/runner-identity.js.map +1 -1
  47. package/dist/storefront/budgets.js +26 -4
  48. package/dist/storefront/budgets.js.map +1 -1
  49. package/dist/storefront/checks/i18n.js +39 -0
  50. package/dist/storefront/checks/i18n.js.map +1 -1
  51. package/dist/storefront/fixture.d.ts +4 -3
  52. package/dist/storefront/fixture.js +12 -7
  53. package/dist/storefront/fixture.js.map +1 -1
  54. package/dist/storefront/gateway.d.ts +18 -2
  55. package/dist/storefront/gateway.js +47 -13
  56. package/dist/storefront/gateway.js.map +1 -1
  57. package/dist/storefront/locale-names.d.ts +39 -0
  58. package/dist/storefront/locale-names.js +63 -0
  59. package/dist/storefront/locale-names.js.map +1 -0
  60. package/dist/suites/app-blocks.d.ts +13 -0
  61. package/dist/suites/app-blocks.js +172 -0
  62. package/dist/suites/app-blocks.js.map +1 -0
  63. package/dist/suites/s1-static.js +4 -2
  64. package/dist/suites/s1-static.js.map +1 -1
  65. package/dist/suites/s2-render.js +20 -2
  66. package/dist/suites/s2-render.js.map +1 -1
  67. package/dist/suites/s4-limits.js +44 -1
  68. package/dist/suites/s4-limits.js.map +1 -1
  69. package/dist/suites/s5-hydration.d.ts +2 -0
  70. package/dist/suites/s5-hydration.js +89 -12
  71. package/dist/suites/s5-hydration.js.map +1 -1
  72. package/dist/workerd/config.js +3 -0
  73. package/dist/workerd/config.js.map +1 -1
  74. package/dist/workerd/elapsed.d.ts +19 -0
  75. package/dist/workerd/elapsed.js +25 -0
  76. package/dist/workerd/elapsed.js.map +1 -0
  77. package/dist/workerd/host.js +11 -4
  78. package/dist/workerd/host.js.map +1 -1
  79. package/dist/workerd/shim.mjs +40 -3
  80. package/dist/workerd/storefront-data.mjs +25 -11
  81. package/dist/workerd/tanqory-money.generated.mjs +551 -0
  82. package/docs/storefront-tier.md +1 -0
  83. package/fixtures/chunks-pass/client/assets/boot-d9c77977.js +13 -0
  84. package/fixtures/chunks-pass/client/assets/core-9e704970.js +21 -0
  85. package/fixtures/chunks-pass/client/assets/hero-f2dd1270.js +3 -0
  86. package/fixtures/chunks-pass/client/assets/main-28182e68.css +1 -0
  87. package/fixtures/chunks-pass/client/assets/main-3401d1c6.js +22 -0
  88. package/fixtures/chunks-pass/client/assets/probe-bad-de7c494b.js +1 -0
  89. package/fixtures/chunks-pass/client/assets/probe-ok-e658f0b4.js +1 -0
  90. package/fixtures/chunks-pass/client/assets/shared-53e84b49.js +2 -0
  91. package/fixtures/chunks-pass/client/client-manifest.json +87 -0
  92. package/fixtures/chunks-pass/defaults/regions/header.json +1 -0
  93. package/fixtures/chunks-pass/defaults/settings.json +1 -0
  94. package/fixtures/chunks-pass/defaults/templates/index.json +1 -0
  95. package/fixtures/chunks-pass/defaults/templates/product.json +1 -0
  96. package/fixtures/chunks-pass/locales/en.json +1 -0
  97. package/fixtures/chunks-pass/manifest.json +1 -0
  98. package/fixtures/chunks-pass/server/entry.mjs +171 -0
  99. package/fixtures/hydration-pass/defaults/templates/product.json +1 -0
  100. package/fixtures/hydration-pass/manifest.json +1 -1
  101. package/fixtures/hydration-pass/server/entry.mjs +7 -1
  102. package/fixtures/hydration-violations/slot-server-children/server/entry.mjs +7 -1
  103. package/fixtures/invalid-url-setting/defaults/templates/product.json +1 -0
  104. package/fixtures/invalid-url-setting/manifest.json +1 -1
  105. package/fixtures/invalid-url-setting/server/entry.mjs +7 -1
  106. package/fixtures/minimal-pass/defaults/templates/product.json +1 -0
  107. package/fixtures/minimal-pass/manifest.json +1 -1
  108. package/fixtures/minimal-pass/server/entry.mjs +7 -1
  109. package/fixtures/violations/defaults/templates/product.json +1 -0
  110. package/fixtures/violations/entries/async-iterable-body.mjs +7 -1
  111. package/fixtures/violations/entries/browser-only-capability.mjs +7 -1
  112. package/fixtures/violations/entries/deferred-ambient-access.mjs +7 -1
  113. package/fixtures/violations/entries/depends-on-harness-scope.mjs +7 -1
  114. package/fixtures/violations/entries/fetch-without-network.mjs +7 -1
  115. package/fixtures/violations/entries/forges-array-push.mjs +7 -1
  116. package/fixtures/violations/entries/forges-json-stringify.mjs +7 -1
  117. package/fixtures/violations/entries/forges-object-then.mjs +7 -1
  118. package/fixtures/violations/entries/forges-to-json.mjs +7 -1
  119. package/fixtures/violations/entries/grants-own-capability.mjs +7 -1
  120. package/fixtures/violations/entries/lowercase-tenant-leak.mjs +7 -1
  121. package/fixtures/violations/entries/nondeterministic-output.mjs +7 -1
  122. package/fixtures/violations/entries/reads-date-now.mjs +7 -1
  123. package/fixtures/violations/entries/reads-new-date.mjs +7 -1
  124. package/fixtures/violations/entries/redefines-prototype-method.mjs +7 -1
  125. package/fixtures/violations/entries/renders-tq-csrf-field.mjs +7 -1
  126. package/fixtures/violations/entries/renders-tq-form-field.mjs +7 -1
  127. package/fixtures/violations/entries/response-too-large.mjs +7 -1
  128. package/fixtures/violations/entries/retains-tenant-state.mjs +7 -1
  129. package/fixtures/violations/entries/signed-in-actions-customer.mjs +7 -1
  130. package/fixtures/violations/entries/signed-in-harness-scope.mjs +7 -1
  131. package/fixtures/violations/entries/slow-cold-render.mjs +7 -1
  132. package/fixtures/violations/entries/slow-signed-in-render.mjs +7 -1
  133. package/fixtures/violations/entries/slow-store-b-render.mjs +7 -1
  134. package/fixtures/violations/entries/stashes-on-date-prototype.mjs +7 -1
  135. package/fixtures/violations/entries/stashes-on-json.mjs +7 -1
  136. package/fixtures/violations/entries/stashes-on-prototype.mjs +7 -1
  137. package/fixtures/violations/entries/swallows-data-limit.mjs +7 -1
  138. package/fixtures/violations/manifest.json +1 -1
  139. package/package.json +7 -14
  140. 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' }] }],
@@ -52,6 +53,11 @@ export const manifest = {
52
53
 
53
54
  const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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' }] }],
@@ -62,6 +63,11 @@ Array.prototype.map = function map(fn, self) {
62
63
 
63
64
  const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[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
  }