@tappify/extension-sdk 2.1.0-beta.1 → 2.1.0

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 (137) hide show
  1. package/README.md +18 -54
  2. package/dist/{chunk-6HETNZJY.cjs → chunk-2DBSVKAU.cjs} +1 -1
  3. package/dist/{chunk-6HETNZJY.cjs.map → chunk-2DBSVKAU.cjs.map} +1 -1
  4. package/dist/{chunk-O357OJXL.cjs → chunk-3YWVYA42.cjs} +18 -14
  5. package/dist/chunk-3YWVYA42.cjs.map +1 -0
  6. package/dist/{chunk-GAUZYBXE.cjs → chunk-5AAPD5WV.cjs} +11 -11
  7. package/dist/chunk-5AAPD5WV.cjs.map +1 -0
  8. package/dist/{chunk-SGEYDV3K.mjs → chunk-BDCX6LRQ.mjs} +3 -3
  9. package/dist/chunk-BDCX6LRQ.mjs.map +1 -0
  10. package/dist/{chunk-KZ5NGFUP.mjs → chunk-C3YNVHBP.mjs} +7 -20
  11. package/dist/chunk-C3YNVHBP.mjs.map +1 -0
  12. package/dist/{chunk-QXD7WVKK.mjs → chunk-CSTYBKZC.mjs} +1 -1
  13. package/dist/chunk-CSTYBKZC.mjs.map +1 -0
  14. package/dist/{chunk-SWG7CNTZ.mjs → chunk-CTSZ5D7S.mjs} +5 -9
  15. package/dist/chunk-CTSZ5D7S.mjs.map +1 -0
  16. package/dist/chunk-EW54H7CR.cjs +722 -0
  17. package/dist/chunk-EW54H7CR.cjs.map +1 -0
  18. package/dist/chunk-EX3NFXDK.mjs +722 -0
  19. package/dist/chunk-EX3NFXDK.mjs.map +1 -0
  20. package/dist/{chunk-A74HCO6T.cjs → chunk-G7XZSN2Q.cjs} +18 -31
  21. package/dist/chunk-G7XZSN2Q.cjs.map +1 -0
  22. package/dist/{chunk-RBIQT75L.mjs → chunk-GG3IX52W.mjs} +2 -2
  23. package/dist/{chunk-SLGOHIBL.mjs → chunk-IGK2AP6J.mjs} +17 -13
  24. package/dist/chunk-IGK2AP6J.mjs.map +1 -0
  25. package/dist/{chunk-VV7ELNRW.cjs → chunk-JMUK3K47.cjs} +3 -3
  26. package/dist/{chunk-VV7ELNRW.cjs.map → chunk-JMUK3K47.cjs.map} +1 -1
  27. package/dist/{chunk-SGCYEEXD.mjs → chunk-MNDVYPEP.mjs} +2 -9
  28. package/dist/chunk-MNDVYPEP.mjs.map +1 -0
  29. package/dist/{chunk-BPCGXXMD.cjs → chunk-NFUPPCX4.cjs} +18 -22
  30. package/dist/chunk-NFUPPCX4.cjs.map +1 -0
  31. package/dist/{chunk-PRCZMOLD.cjs → chunk-OPPYEA7F.cjs} +3 -3
  32. package/dist/{chunk-PRCZMOLD.cjs.map → chunk-OPPYEA7F.cjs.map} +1 -1
  33. package/dist/{chunk-7YKH4LZN.cjs → chunk-PYJMJF44.cjs} +2 -9
  34. package/dist/chunk-PYJMJF44.cjs.map +1 -0
  35. package/dist/{chunk-QA5AL3VZ.mjs → chunk-QHM7XNRK.mjs} +2 -2
  36. package/dist/{chunk-QA5AL3VZ.mjs.map → chunk-QHM7XNRK.mjs.map} +1 -1
  37. package/dist/codegen.cjs.map +1 -1
  38. package/dist/codegen.d.cts +7 -40
  39. package/dist/codegen.d.ts +7 -40
  40. package/dist/codegen.mjs.map +1 -1
  41. package/dist/{constants-BAimnqOK.d.cts → constants-DJ_KgZpN.d.cts} +8 -41
  42. package/dist/{constants-BAimnqOK.d.ts → constants-DJ_KgZpN.d.ts} +8 -41
  43. package/dist/{context-Cr93B05o.d.ts → context-Dt6xh_5t.d.cts} +4 -5
  44. package/dist/{context-DJ3REtdT.d.cts → context-Ml7k_V14.d.ts} +4 -5
  45. package/dist/{errors-Cqh0wrqt.d.ts → errors-COsBh7kd.d.cts} +2 -3
  46. package/dist/{errors-Cqh0wrqt.d.cts → errors-COsBh7kd.d.ts} +2 -3
  47. package/dist/handler-CZIlZ5vu.d.ts +227 -0
  48. package/dist/handler-kU9Jf36K.d.cts +227 -0
  49. package/dist/host.cjs +4 -4
  50. package/dist/host.d.cts +4 -4
  51. package/dist/host.d.ts +4 -4
  52. package/dist/host.mjs +3 -3
  53. package/dist/index.cjs +34 -5
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.cts +627 -69
  56. package/dist/index.d.ts +627 -69
  57. package/dist/index.mjs +33 -4
  58. package/dist/manifest.cjs +23 -132
  59. package/dist/manifest.cjs.map +1 -1
  60. package/dist/manifest.d.cts +12 -93
  61. package/dist/manifest.d.ts +12 -93
  62. package/dist/manifest.mjs +9 -118
  63. package/dist/manifest.mjs.map +1 -1
  64. package/dist/server.cjs +66 -14
  65. package/dist/server.cjs.map +1 -1
  66. package/dist/server.d.cts +6 -6
  67. package/dist/server.d.ts +6 -6
  68. package/dist/server.mjs +61 -9
  69. package/dist/server.mjs.map +1 -1
  70. package/dist/styles.css +367 -0
  71. package/dist/testing/index.cjs +13 -72
  72. package/dist/testing/index.cjs.map +1 -1
  73. package/dist/testing/index.d.cts +10 -29
  74. package/dist/testing/index.d.ts +10 -29
  75. package/dist/testing/index.mjs +13 -72
  76. package/dist/testing/index.mjs.map +1 -1
  77. package/dist/testing/jest.cjs +5 -5
  78. package/dist/testing/jest.mjs +2 -2
  79. package/dist/testing/vitest.cjs +5 -5
  80. package/dist/testing/vitest.cjs.map +1 -1
  81. package/dist/testing/vitest.d.cts +0 -10
  82. package/dist/testing/vitest.d.ts +0 -10
  83. package/dist/testing/vitest.mjs +2 -2
  84. package/dist/testing/vitest.mjs.map +1 -1
  85. package/dist/{types-BYGcp5pZ.d.ts → types-DDAGLpov.d.ts} +3 -4
  86. package/dist/{types-I1JOZyI_.d.cts → types-DrpQSv_2.d.cts} +3 -4
  87. package/dist/vite-preview.cjs +125 -294
  88. package/dist/vite-preview.cjs.map +1 -1
  89. package/dist/vite-preview.d.cts +24 -6
  90. package/dist/vite-preview.d.ts +24 -6
  91. package/dist/vite-preview.mjs +118 -287
  92. package/dist/vite-preview.mjs.map +1 -1
  93. package/dist/vite.cjs +23 -133
  94. package/dist/vite.cjs.map +1 -1
  95. package/dist/vite.d.cts +7 -40
  96. package/dist/vite.d.ts +7 -40
  97. package/dist/vite.mjs +17 -127
  98. package/dist/vite.mjs.map +1 -1
  99. package/package.json +2 -12
  100. package/schema/extension-v2.json +121 -432
  101. package/dist/chunk-2CY5HVY7.mjs +0 -59
  102. package/dist/chunk-2CY5HVY7.mjs.map +0 -1
  103. package/dist/chunk-7YKH4LZN.cjs.map +0 -1
  104. package/dist/chunk-A74HCO6T.cjs.map +0 -1
  105. package/dist/chunk-BPCGXXMD.cjs.map +0 -1
  106. package/dist/chunk-EB5XWQAU.cjs +0 -132
  107. package/dist/chunk-EB5XWQAU.cjs.map +0 -1
  108. package/dist/chunk-GAUZYBXE.cjs.map +0 -1
  109. package/dist/chunk-KZ5NGFUP.mjs.map +0 -1
  110. package/dist/chunk-O357OJXL.cjs.map +0 -1
  111. package/dist/chunk-ONJMPO3P.cjs +0 -59
  112. package/dist/chunk-ONJMPO3P.cjs.map +0 -1
  113. package/dist/chunk-QJMZRV7A.mjs +0 -132
  114. package/dist/chunk-QJMZRV7A.mjs.map +0 -1
  115. package/dist/chunk-QXD7WVKK.mjs.map +0 -1
  116. package/dist/chunk-SGCYEEXD.mjs.map +0 -1
  117. package/dist/chunk-SGEYDV3K.mjs.map +0 -1
  118. package/dist/chunk-SLGOHIBL.mjs.map +0 -1
  119. package/dist/chunk-SWG7CNTZ.mjs.map +0 -1
  120. package/dist/client-CV1qzQgx.d.cts +0 -25
  121. package/dist/client-CnlSHDWE.d.ts +0 -25
  122. package/dist/ui/styles.css +0 -740
  123. package/dist/ui.cjs +0 -1018
  124. package/dist/ui.cjs.map +0 -1
  125. package/dist/ui.d.cts +0 -231
  126. package/dist/ui.d.ts +0 -231
  127. package/dist/ui.mjs +0 -1018
  128. package/dist/ui.mjs.map +0 -1
  129. package/dist/vite-preview-bootstrap.cjs +0 -66
  130. package/dist/vite-preview-bootstrap.cjs.map +0 -1
  131. package/dist/vite-preview-bootstrap.d.cts +0 -15
  132. package/dist/vite-preview-bootstrap.d.ts +0 -15
  133. package/dist/vite-preview-bootstrap.mjs +0 -66
  134. package/dist/vite-preview-bootstrap.mjs.map +0 -1
  135. package/dist/work-events-DB3WR468.d.ts +0 -547
  136. package/dist/work-events-Dxe7Djdy.d.cts +0 -547
  137. /package/dist/{chunk-RBIQT75L.mjs.map → chunk-GG3IX52W.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkONJMPO3Pcjs = require('./chunk-ONJMPO3P.cjs');
3
+ var _chunkEW54H7CRcjs = require('./chunk-EW54H7CR.cjs');
4
4
 
5
5
 
6
6
 
@@ -9,16 +9,16 @@ var _chunkNN263PGQcjs = require('./chunk-NN263PGQ.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkBPCGXXMDcjs = require('./chunk-BPCGXXMD.cjs');
13
- require('./chunk-GAUZYBXE.cjs');
12
+ var _chunkNFUPPCX4cjs = require('./chunk-NFUPPCX4.cjs');
13
+ require('./chunk-5AAPD5WV.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkVV7ELNRWcjs = require('./chunk-VV7ELNRW.cjs');
18
- require('./chunk-PRCZMOLD.cjs');
19
- require('./chunk-A74HCO6T.cjs');
20
- require('./chunk-7YKH4LZN.cjs');
21
- require('./chunk-6HETNZJY.cjs');
17
+ var _chunkJMUK3K47cjs = require('./chunk-JMUK3K47.cjs');
18
+ require('./chunk-OPPYEA7F.cjs');
19
+ require('./chunk-G7XZSN2Q.cjs');
20
+ require('./chunk-PYJMJF44.cjs');
21
+ require('./chunk-2DBSVKAU.cjs');
22
22
  require('./chunk-Q7SFCCGT.cjs');
23
23
 
24
24
  // src/vite-preview.tsx
@@ -28,18 +28,13 @@ var _client = require('react-dom/client');
28
28
  var _reactquery = require('@tanstack/react-query'); var TanstackQuery = _interopRequireWildcard(_reactquery);
29
29
  var _react = require('react'); var React = _interopRequireWildcard(_react);
30
30
 
31
-
32
-
33
-
34
-
35
-
36
31
  var _reactdom = require('react-dom'); var ReactDom = _interopRequireWildcard(_reactdom);
37
32
  var _jsxruntime = require('react/jsx-runtime'); var JsxRuntime = _interopRequireWildcard(_jsxruntime);
38
33
 
39
34
  // package.json
40
35
  var package_default = {
41
36
  name: "@tappify/extension-sdk",
42
- version: "2.1.0-beta.1",
37
+ version: "2.1.0",
43
38
  description: "Build extensions that run inside Tappify",
44
39
  author: "Tappify Team",
45
40
  license: "MIT",
@@ -65,11 +60,6 @@ var package_default = {
65
60
  import: "./dist/host.mjs",
66
61
  require: "./dist/host.cjs"
67
62
  },
68
- "./ui": {
69
- types: "./dist/ui.d.ts",
70
- import: "./dist/ui.mjs",
71
- require: "./dist/ui.cjs"
72
- },
73
63
  "./vite": {
74
64
  types: "./dist/vite.d.ts",
75
65
  import: "./dist/vite.mjs",
@@ -80,11 +70,6 @@ var package_default = {
80
70
  import: "./dist/vite-preview.mjs",
81
71
  require: "./dist/vite-preview.cjs"
82
72
  },
83
- "./vite/preview/bootstrap": {
84
- types: "./dist/vite-preview-bootstrap.d.ts",
85
- import: "./dist/vite-preview-bootstrap.mjs",
86
- require: "./dist/vite-preview-bootstrap.cjs"
87
- },
88
73
  "./testing": {
89
74
  types: "./dist/testing/index.d.ts",
90
75
  import: "./dist/testing/index.mjs",
@@ -105,7 +90,7 @@ var package_default = {
105
90
  import: "./dist/codegen.mjs",
106
91
  require: "./dist/codegen.cjs"
107
92
  },
108
- "./ui/styles.css": "./dist/ui/styles.css",
93
+ "./styles.css": "./dist/styles.css",
109
94
  "./schema/extension-v2.json": "./schema/extension-v2.json",
110
95
  "./package.json": "./package.json"
111
96
  },
@@ -392,7 +377,7 @@ function previewProps(contribution, state) {
392
377
  case "widget":
393
378
  return { config: {} };
394
379
  case "rowAction":
395
- return { row: { ..._chunkBPCGXXMDcjs.fixtureKeywords[0] } };
380
+ return { row: { ..._chunkNFUPPCX4cjs.fixtureKeywords[0] } };
396
381
  case "settings":
397
382
  return {
398
383
  values: state.settings,
@@ -405,106 +390,32 @@ function previewProps(contribution, state) {
405
390
  var previewStyles = `
406
391
  :root {
407
392
  color-scheme: light;
408
- font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
409
- background: #f2f3ee;
410
- color: #121212;
411
- font-synthesis: none;
412
- text-rendering: optimizeLegibility;
393
+ font-family: Inter, ui-sans-serif, system-ui, sans-serif;
394
+ background: #f4f5ef;
395
+ color: #142012;
413
396
  }
414
397
  * { box-sizing: border-box; }
415
- body { margin: 0; min-width: 320px; background: #f2f3ee; }
398
+ body { margin: 0; min-width: 320px; }
416
399
  button, select { font: inherit; }
417
- .tap-preview {
418
- --preview-canvas: #f2f3ee;
419
- --preview-paper: #fdfdfd;
420
- --preview-ink: #121212;
421
- --preview-muted: #686b66;
422
- --preview-border: #d5d7d1;
423
- --preview-control: #f7f8f4;
424
- --preview-green: #235027;
425
- min-height: 100vh;
426
- display: grid;
427
- grid-template-rows: auto 1fr;
428
- background: var(--preview-canvas);
429
- color: var(--preview-ink);
430
- }
431
- .tap-preview[data-theme="dark"] {
432
- color-scheme: dark;
433
- --preview-canvas: #111216;
434
- --preview-paper: #181920;
435
- --preview-ink: #f4f5f1;
436
- --preview-muted: #a7aaa4;
437
- --preview-border: #303239;
438
- --preview-control: #202229;
439
- --preview-green: #b4d773;
440
- }
441
- .tap-preview-bar {
442
- min-height: 68px;
443
- display: flex;
444
- gap: 24px;
445
- align-items: center;
446
- padding: 12px 20px;
447
- border-bottom: 1px solid var(--preview-border);
448
- background: var(--preview-paper);
449
- }
450
- .tap-preview-brand { min-width: 210px; margin-right: auto; display: flex; align-items: center; gap: 10px; }
451
- .tap-preview-brand img { width: 36px; height: 36px; flex: 0 0 auto; object-fit: cover; border: 1px solid var(--preview-border); border-radius: 8px; background: #fff; }
400
+ .tap-preview { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
401
+ .tap-preview[data-theme="dark"] { color-scheme: dark; background: #111710; color: #f2f5ec; }
402
+ .tap-preview-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 16px 20px; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); background: color-mix(in srgb, Canvas 94%, transparent); }
403
+ .tap-preview-brand { margin-right: auto; min-width: 190px; }
452
404
  .tap-preview-brand strong, .tap-preview-brand span { display: block; }
453
- .tap-preview-brand strong { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
454
- .tap-preview-brand span { margin-top: 2px; color: var(--preview-muted); font-size: 11px; }
455
- .tap-preview-brand i { width: 6px; height: 6px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #64a75f; box-shadow: 0 0 0 2px rgb(100 167 95 / 14%); }
456
- .tap-preview-controls { display: flex; align-items: end; gap: 8px; }
457
- .tap-preview-field { min-width: 104px; display: grid; gap: 4px; color: var(--preview-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.045em; text-transform: uppercase; }
458
- .tap-preview-field--contribution { min-width: 190px; }
459
- .tap-preview-field select, .tap-preview-reset {
460
- height: 32px;
461
- border: 1px solid var(--preview-border);
462
- border-radius: 6px;
463
- outline: none;
464
- background: var(--preview-control);
465
- color: var(--preview-ink);
466
- font-size: 12px;
467
- font-weight: 500;
468
- letter-spacing: normal;
469
- text-transform: none;
470
- }
471
- .tap-preview-field select { width: 100%; padding: 0 28px 0 9px; cursor: pointer; }
472
- .tap-preview-field select:focus, .tap-preview-reset:focus-visible { border-color: var(--preview-green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--preview-green) 18%, transparent); }
473
- .tap-preview-reset { padding: 0 12px; cursor: pointer; }
474
- .tap-preview-reset:hover { border-color: color-mix(in srgb, var(--preview-ink) 34%, var(--preview-border)); background: var(--preview-paper); }
475
- .tap-preview-stage { min-width: 0; padding: 22px 24px 14px; overflow: auto; }
476
- .tap-preview-canvas {
477
- width: 100%;
478
- max-width: 1440px;
479
- height: max(380px, calc(100vh - 118px));
480
- margin: 0 auto;
481
- border: 1px solid var(--preview-border);
482
- border-radius: 8px;
483
- overflow: hidden;
484
- background: var(--preview-paper);
485
- color: var(--preview-ink);
486
- box-shadow: 0 2px 8px rgb(20 24 18 / 5%);
487
- transition: max-width 160ms ease;
488
- }
405
+ .tap-preview-brand span, .tap-preview-note { color: color-mix(in srgb, currentColor 62%, transparent); font-size: 12px; }
406
+ .tap-preview-field { display: grid; gap: 5px; font-size: 12px; }
407
+ .tap-preview-field select, .tap-preview-reset { min-height: 34px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 7px; background: Canvas; color: CanvasText; padding: 6px 9px; }
408
+ .tap-preview-reset { cursor: pointer; }
409
+ .tap-preview-stage { padding: 24px; overflow: auto; }
410
+ .tap-preview-canvas { width: 100%; min-height: 520px; margin: 0 auto; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: 12px; background: Canvas; color: CanvasText; box-shadow: 0 12px 36px rgb(20 32 18 / 9%); transition: max-width 160ms ease; }
489
411
  .tap-preview-canvas[data-viewport="tablet"] { max-width: 768px; }
490
412
  .tap-preview-canvas[data-viewport="mobile"] { max-width: 390px; }
491
- .tap-preview-canvas[data-size="slot"] { width: min(100%, 680px); height: 380px; }
492
- .tap-preview-canvas[data-size="panel"] { width: min(100%, 960px); height: clamp(420px, calc(100vh - 118px), 620px); }
493
- .tap-preview-canvas[data-size="page"] { height: max(380px, calc(100vh - 118px)); }
494
- .tap-preview-surface { display: block; height: 100%; min-height: 0; }
413
+ .tap-preview-surface { min-height: 100%; padding: 24px; }
495
414
  .tap-preview-message { min-height: 360px; display: grid; place-content: center; gap: 8px; padding: 32px; text-align: center; }
496
- .tap-preview-message span { max-width: 62ch; color: var(--preview-muted); }
415
+ .tap-preview-message span { max-width: 62ch; color: color-mix(in srgb, currentColor 68%, transparent); }
497
416
  @media (max-width: 640px) {
498
417
  .tap-preview-stage { padding: 12px; }
499
- .tap-preview-bar { align-items: flex-start; padding: 12px; }
500
- .tap-preview-brand { min-width: 0; }
501
- .tap-preview-controls { width: 100%; overflow-x: auto; padding-bottom: 2px; }
502
- .tap-preview-field { min-width: 100px; }
503
- .tap-preview-field--contribution { min-width: 180px; }
504
- }
505
- @media (max-width: 900px) {
506
- .tap-preview-bar { flex-wrap: wrap; gap: 12px; }
507
- .tap-preview-controls { flex: 1 1 100%; }
418
+ .tap-preview-bar { padding: 12px; }
508
419
  }
509
420
  `;
510
421
 
@@ -546,7 +457,7 @@ async function federationFor(extensionId, remote) {
546
457
  },
547
458
  "@tappify/extension-sdk": {
548
459
  version: package_default.version,
549
- lib: () => _chunkONJMPO3Pcjs.src_exports,
460
+ lib: () => _chunkEW54H7CRcjs.src_exports,
550
461
  shareConfig: SINGLETON
551
462
  }
552
463
  }
@@ -564,14 +475,6 @@ function componentFromModule(module, expose) {
564
475
  }
565
476
  return candidate;
566
477
  }
567
- function stylesFromModule(module) {
568
- if (typeof module !== "object" || module === null || !("styles" in module) || !Array.isArray(module.styles)) {
569
- return [];
570
- }
571
- return module.styles.filter(
572
- (style) => typeof style === "string"
573
- );
574
- }
575
478
  async function loadContribution({
576
479
  extensionId,
577
480
  remote,
@@ -590,18 +493,6 @@ function isExternalRemote(remote) {
590
493
  return true;
591
494
  }
592
495
  }
593
- function localProcedureStubs(manifest) {
594
- return Object.fromEntries(
595
- Object.keys(_nullishCoalesce(_optionalChain([manifest, 'access', _ => _.server, 'optionalAccess', _2 => _2.procedures]), () => ( {}))).map((name) => [
596
- name,
597
- () => {
598
- throw new Error(
599
- "This view needs live server data. Run tappify extension dev --live to connect it."
600
- );
601
- }
602
- ])
603
- );
604
- }
605
496
  function Message({
606
497
  title,
607
498
  children
@@ -611,58 +502,6 @@ function Message({
611
502
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children })
612
503
  ] });
613
504
  }
614
- function PreviewSurface({
615
- portal,
616
- styles,
617
- children
618
- }) {
619
- const [nodes, setNodes] = _react.useState.call(void 0, null);
620
- const attachHost = _react.useCallback.call(void 0, (host) => {
621
- if (host === null) return;
622
- const root = _nullishCoalesce(host.shadowRoot, () => ( host.attachShadow({ mode: "open" })));
623
- let content = root.querySelector("[data-tap-content]");
624
- if (content === null) {
625
- content = document.createElement("div");
626
- content.className = "tap-root";
627
- content.setAttribute("data-tap-content", "");
628
- root.appendChild(content);
629
- }
630
- setNodes({ root, content });
631
- }, []);
632
- _react.useEffect.call(void 0, () => {
633
- if (nodes === null) return;
634
- nodes.root.appendChild(portal);
635
- return () => portal.remove();
636
- }, [nodes, portal]);
637
- _react.useEffect.call(void 0, () => {
638
- if (nodes === null) return;
639
- const injected = [];
640
- const inject = (kind, css) => {
641
- const element = document.createElement("style");
642
- element.setAttribute("data-tap-style", kind);
643
- element.textContent = css;
644
- nodes.root.insertBefore(element, nodes.content);
645
- injected.push(element);
646
- };
647
- inject(
648
- "preview",
649
- ":host { display: block; height: 100%; min-height: 0; overflow: auto; } .tap-root { box-sizing: border-box; height: 100%; min-height: 100%; padding: 24px; }"
650
- );
651
- for (const css of styles) inject("remote", css);
652
- return () => {
653
- for (const element of injected) element.remove();
654
- };
655
- }, [nodes, styles]);
656
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
657
- "div",
658
- {
659
- ref: attachHost,
660
- className: "tap-preview-surface",
661
- "data-tap-preview-surface": true,
662
- children: nodes === null ? null : ReactDom.createPortal(children, nodes.content)
663
- }
664
- );
665
- }
666
505
  function LocalPreview({
667
506
  manifest,
668
507
  remote,
@@ -670,7 +509,7 @@ function LocalPreview({
670
509
  }) {
671
510
  const selections = _react.useMemo.call(void 0, () => previewSelections(manifest), [manifest]);
672
511
  const [expose, setExpose] = _react.useState.call(void 0,
673
- _nullishCoalesce(_optionalChain([selections, 'access', _3 => _3[0], 'optionalAccess', _4 => _4.contribution, 'access', _5 => _5.expose]), () => ( ""))
512
+ _nullishCoalesce(_optionalChain([selections, 'access', _ => _[0], 'optionalAccess', _2 => _2.contribution, 'access', _3 => _3.expose]), () => ( ""))
674
513
  );
675
514
  const [theme, setTheme] = _react.useState.call(void 0, "light");
676
515
  const [viewport, setViewport] = _react.useState.call(void 0, "desktop");
@@ -682,8 +521,8 @@ function LocalPreview({
682
521
  status: "loading"
683
522
  });
684
523
  const selection = _nullishCoalesce(selections.find((item) => item.contribution.expose === expose), () => ( selections[0]));
685
- const contribution = _optionalChain([selection, 'optionalAccess', _6 => _6.contribution]);
686
- const loadKey = `${remote}|${_nullishCoalesce(_optionalChain([contribution, 'optionalAccess', _7 => _7.expose]), () => ( ""))}`;
524
+ const contribution = _optionalChain([selection, 'optionalAccess', _4 => _4.contribution]);
525
+ const loadKey = `${remote}|${_nullishCoalesce(_optionalChain([contribution, 'optionalAccess', _5 => _5.expose]), () => ( ""))}`;
687
526
  _react.useEffect.call(void 0, () => {
688
527
  if (contribution === void 0) return;
689
528
  let cancelled = false;
@@ -697,8 +536,7 @@ function LocalPreview({
697
536
  setLoaded({
698
537
  key: loadKey,
699
538
  status: "ready",
700
- Component: componentFromModule(module, contribution.expose),
701
- styles: stylesFromModule(module)
539
+ Component: componentFromModule(module, contribution.expose)
702
540
  });
703
541
  }).catch((error) => {
704
542
  if (cancelled) return;
@@ -714,18 +552,17 @@ function LocalPreview({
714
552
  }, [contribution, loadKey, loader, manifest.id, remote]);
715
553
  const host = _react.useMemo.call(void 0, () => {
716
554
  void generation;
717
- return _chunkBPCGXXMDcjs.createTapMock.call(void 0, {
555
+ return _chunkNFUPPCX4cjs.createTapMock.call(void 0, {
718
556
  extensionId: manifest.id,
719
557
  extensionName: manifest.name,
720
- project: _chunkBPCGXXMDcjs.fixtures.project.project,
558
+ project: _chunkNFUPPCX4cjs.fixtures.project.project,
721
559
  theme,
722
- size,
723
- server: localProcedureStubs(manifest)
560
+ size
724
561
  });
725
- }, [generation, manifest, size, theme]);
562
+ }, [generation, manifest.id, manifest.name, size, theme]);
726
563
  const queryClient = _react.useMemo.call(void 0, () => {
727
564
  void generation;
728
- return _chunkVV7ELNRWcjs.createHostQueryClient.call(void 0, );
565
+ return _chunkJMUK3K47cjs.createHostQueryClient.call(void 0, );
729
566
  }, [generation]);
730
567
  const current = loaded.key === loadKey ? loaded : { key: loadKey, status: "loading" };
731
568
  let content;
@@ -742,7 +579,7 @@ function LocalPreview({
742
579
  settings,
743
580
  onSettingsChange: setSettings
744
581
  });
745
- content = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVV7ELNRWcjs.TapHostProvider, { tap: host.tap, queryClient, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PreviewSurface, { portal: host.portal, styles: current.styles, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PreviewErrorBoundary, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { ...props }) }, `${loadKey}|${String(generation)}`) }) });
582
+ content = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJMUK3K47cjs.TapHostProvider, { tap: host.tap, queryClient, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PreviewErrorBoundary, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tap-preview-surface", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { ...props }) }) }, `${loadKey}|${String(generation)}`) });
746
583
  } else {
747
584
  content = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Message, { title: "Loading contribution", children: [
748
585
  "Loading ",
@@ -754,105 +591,99 @@ function LocalPreview({
754
591
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: previewStyles }),
755
592
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: "tap-preview-bar", children: [
756
593
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tap-preview-brand", children: [
757
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: `/${manifest.icon.replace(/^\.\//, "")}`, alt: "" }),
758
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
759
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: manifest.name }),
760
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
761
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "i", { "aria-hidden": "true" }),
762
- isExternalRemote(remote) ? "External remote" : "Local preview",
763
- " \xB7 Fixture data"
764
- ] })
594
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: manifest.name }),
595
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
596
+ isExternalRemote(remote) ? "External remote" : "Local preview",
597
+ " \xB7 Fixture data"
765
598
  ] })
766
599
  ] }),
767
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tap-preview-controls", children: [
768
- selections.length > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field tap-preview-field--contribution", children: [
769
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Contribution" }),
770
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
771
- "select",
772
- {
773
- value: _nullishCoalesce(_optionalChain([contribution, 'optionalAccess', _8 => _8.expose]), () => ( "")),
774
- onChange: (event) => setExpose(event.target.value),
775
- children: selections.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
776
- "option",
777
- {
778
- value: item.contribution.expose,
779
- children: item.label
780
- },
781
- item.contribution.expose
782
- ))
783
- }
784
- )
785
- ] }) : null,
786
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
787
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Theme" }),
788
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
789
- "select",
790
- {
791
- value: theme,
792
- onChange: (event) => setTheme(event.target.value),
793
- children: [
794
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "light", children: "Light" }),
795
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "dark", children: "Dark" })
796
- ]
797
- }
798
- )
799
- ] }),
800
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
801
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Viewport" }),
802
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
803
- "select",
804
- {
805
- value: viewport,
806
- onChange: (event) => setViewport(event.target.value),
807
- children: [
808
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "desktop", children: "Desktop" }),
809
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "tablet", children: "Tablet" }),
810
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "mobile", children: "Mobile" })
811
- ]
812
- }
813
- )
814
- ] }),
815
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
816
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Surface" }),
817
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
818
- "select",
819
- {
820
- value: size,
821
- "aria-label": "Surface size",
822
- onChange: (event) => setSize(event.target.value),
823
- children: [
824
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "slot", children: "Slot" }),
825
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "panel", children: "Panel" }),
826
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "page", children: "Page" })
827
- ]
828
- }
829
- )
830
- ] }),
600
+ selections.length > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
601
+ "Contribution",
831
602
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
832
- "button",
603
+ "select",
604
+ {
605
+ value: _nullishCoalesce(_optionalChain([contribution, 'optionalAccess', _6 => _6.expose]), () => ( "")),
606
+ onChange: (event) => setExpose(event.target.value),
607
+ children: selections.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
608
+ "option",
609
+ {
610
+ value: item.contribution.expose,
611
+ children: item.label
612
+ },
613
+ item.contribution.expose
614
+ ))
615
+ }
616
+ )
617
+ ] }) : null,
618
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
619
+ "Theme",
620
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
621
+ "select",
833
622
  {
834
- className: "tap-preview-reset",
835
- type: "button",
836
- "aria-label": "Reset fixtures",
837
- onClick: () => {
838
- setSettings({});
839
- setGeneration((value) => value + 1);
840
- },
841
- children: "Reset"
623
+ value: theme,
624
+ onChange: (event) => setTheme(event.target.value),
625
+ children: [
626
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "light", children: "Light" }),
627
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "dark", children: "Dark" })
628
+ ]
842
629
  }
843
630
  )
844
- ] })
631
+ ] }),
632
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
633
+ "Viewport",
634
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
635
+ "select",
636
+ {
637
+ value: viewport,
638
+ onChange: (event) => setViewport(event.target.value),
639
+ children: [
640
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "desktop", children: "Desktop" }),
641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "tablet", children: "Tablet" }),
642
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "mobile", children: "Mobile" })
643
+ ]
644
+ }
645
+ )
646
+ ] }),
647
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "tap-preview-field", children: [
648
+ "Surface size",
649
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
650
+ "select",
651
+ {
652
+ value: size,
653
+ onChange: (event) => setSize(event.target.value),
654
+ children: [
655
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "slot", children: "Slot" }),
656
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "panel", children: "Panel" }),
657
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: "page", children: "Page" })
658
+ ]
659
+ }
660
+ )
661
+ ] }),
662
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
663
+ "button",
664
+ {
665
+ className: "tap-preview-reset",
666
+ type: "button",
667
+ onClick: () => {
668
+ setSettings({});
669
+ setGeneration((value) => value + 1);
670
+ },
671
+ children: "Reset fixtures"
672
+ }
673
+ )
845
674
  ] }),
846
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "section", { className: "tap-preview-stage", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
847
- "div",
848
- {
849
- className: "tap-preview-canvas",
850
- "data-viewport": viewport,
851
- "data-size": size,
852
- "aria-label": "Preview canvas",
853
- children: content
854
- }
855
- ) })
675
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "tap-preview-stage", children: [
676
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
677
+ "div",
678
+ {
679
+ className: "tap-preview-canvas",
680
+ "data-viewport": viewport,
681
+ "aria-label": "Preview canvas",
682
+ children: content
683
+ }
684
+ ),
685
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tap-preview-note", children: "Server procedures are unavailable locally. Use `tappify extension dev --live` for real host and server behavior." })
686
+ ] })
856
687
  ] });
857
688
  }
858
689