@tappify/extension-sdk 2.1.0-beta.2 → 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.
- package/README.md +18 -54
- package/dist/{chunk-6HETNZJY.cjs → chunk-2DBSVKAU.cjs} +1 -1
- package/dist/{chunk-6HETNZJY.cjs.map → chunk-2DBSVKAU.cjs.map} +1 -1
- package/dist/{chunk-O357OJXL.cjs → chunk-3YWVYA42.cjs} +18 -14
- package/dist/chunk-3YWVYA42.cjs.map +1 -0
- package/dist/{chunk-GAUZYBXE.cjs → chunk-5AAPD5WV.cjs} +11 -11
- package/dist/chunk-5AAPD5WV.cjs.map +1 -0
- package/dist/{chunk-SGEYDV3K.mjs → chunk-BDCX6LRQ.mjs} +3 -3
- package/dist/chunk-BDCX6LRQ.mjs.map +1 -0
- package/dist/{chunk-KZ5NGFUP.mjs → chunk-C3YNVHBP.mjs} +7 -20
- package/dist/chunk-C3YNVHBP.mjs.map +1 -0
- package/dist/{chunk-QXD7WVKK.mjs → chunk-CSTYBKZC.mjs} +1 -1
- package/dist/chunk-CSTYBKZC.mjs.map +1 -0
- package/dist/{chunk-SWG7CNTZ.mjs → chunk-CTSZ5D7S.mjs} +5 -9
- package/dist/chunk-CTSZ5D7S.mjs.map +1 -0
- package/dist/chunk-EW54H7CR.cjs +722 -0
- package/dist/chunk-EW54H7CR.cjs.map +1 -0
- package/dist/chunk-EX3NFXDK.mjs +722 -0
- package/dist/chunk-EX3NFXDK.mjs.map +1 -0
- package/dist/{chunk-A74HCO6T.cjs → chunk-G7XZSN2Q.cjs} +18 -31
- package/dist/chunk-G7XZSN2Q.cjs.map +1 -0
- package/dist/{chunk-RBIQT75L.mjs → chunk-GG3IX52W.mjs} +2 -2
- package/dist/{chunk-SLGOHIBL.mjs → chunk-IGK2AP6J.mjs} +17 -13
- package/dist/chunk-IGK2AP6J.mjs.map +1 -0
- package/dist/{chunk-VV7ELNRW.cjs → chunk-JMUK3K47.cjs} +3 -3
- package/dist/{chunk-VV7ELNRW.cjs.map → chunk-JMUK3K47.cjs.map} +1 -1
- package/dist/{chunk-SGCYEEXD.mjs → chunk-MNDVYPEP.mjs} +2 -9
- package/dist/chunk-MNDVYPEP.mjs.map +1 -0
- package/dist/{chunk-BPCGXXMD.cjs → chunk-NFUPPCX4.cjs} +18 -22
- package/dist/chunk-NFUPPCX4.cjs.map +1 -0
- package/dist/{chunk-PRCZMOLD.cjs → chunk-OPPYEA7F.cjs} +3 -3
- package/dist/{chunk-PRCZMOLD.cjs.map → chunk-OPPYEA7F.cjs.map} +1 -1
- package/dist/{chunk-7YKH4LZN.cjs → chunk-PYJMJF44.cjs} +2 -9
- package/dist/chunk-PYJMJF44.cjs.map +1 -0
- package/dist/{chunk-QA5AL3VZ.mjs → chunk-QHM7XNRK.mjs} +2 -2
- package/dist/{chunk-QA5AL3VZ.mjs.map → chunk-QHM7XNRK.mjs.map} +1 -1
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.d.cts +7 -43
- package/dist/codegen.d.ts +7 -43
- package/dist/codegen.mjs.map +1 -1
- package/dist/{constants-Bh759FUI.d.cts → constants-DJ_KgZpN.d.cts} +8 -44
- package/dist/{constants-Bh759FUI.d.ts → constants-DJ_KgZpN.d.ts} +8 -44
- package/dist/{context-mr8R5CNt.d.ts → context-Dt6xh_5t.d.cts} +4 -5
- package/dist/{context-DI0EJCRD.d.cts → context-Ml7k_V14.d.ts} +4 -5
- package/dist/{errors-Cqh0wrqt.d.ts → errors-COsBh7kd.d.cts} +2 -3
- package/dist/{errors-Cqh0wrqt.d.cts → errors-COsBh7kd.d.ts} +2 -3
- package/dist/handler-CZIlZ5vu.d.ts +227 -0
- package/dist/handler-kU9Jf36K.d.cts +227 -0
- package/dist/host.cjs +4 -4
- package/dist/host.d.cts +4 -4
- package/dist/host.d.ts +4 -4
- package/dist/host.mjs +3 -3
- package/dist/index.cjs +34 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +627 -69
- package/dist/index.d.ts +627 -69
- package/dist/index.mjs +33 -4
- package/dist/manifest.cjs +24 -136
- package/dist/manifest.cjs.map +1 -1
- package/dist/manifest.d.cts +12 -97
- package/dist/manifest.d.ts +12 -97
- package/dist/manifest.mjs +10 -122
- package/dist/manifest.mjs.map +1 -1
- package/dist/server.cjs +66 -14
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +6 -6
- package/dist/server.d.ts +6 -6
- package/dist/server.mjs +61 -9
- package/dist/server.mjs.map +1 -1
- package/dist/styles.css +367 -0
- package/dist/testing/index.cjs +13 -72
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +10 -29
- package/dist/testing/index.d.ts +10 -29
- package/dist/testing/index.mjs +13 -72
- package/dist/testing/index.mjs.map +1 -1
- package/dist/testing/jest.cjs +5 -5
- package/dist/testing/jest.mjs +2 -2
- package/dist/testing/vitest.cjs +5 -5
- package/dist/testing/vitest.cjs.map +1 -1
- package/dist/testing/vitest.d.cts +0 -10
- package/dist/testing/vitest.d.ts +0 -10
- package/dist/testing/vitest.mjs +2 -2
- package/dist/testing/vitest.mjs.map +1 -1
- package/dist/{types-uGHrRaOj.d.ts → types-DDAGLpov.d.ts} +3 -4
- package/dist/{types-BdDaLnqs.d.cts → types-DrpQSv_2.d.cts} +3 -4
- package/dist/vite-preview.cjs +125 -294
- package/dist/vite-preview.cjs.map +1 -1
- package/dist/vite-preview.d.cts +24 -6
- package/dist/vite-preview.d.ts +24 -6
- package/dist/vite-preview.mjs +118 -287
- package/dist/vite-preview.mjs.map +1 -1
- package/dist/vite.cjs +24 -137
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +7 -43
- package/dist/vite.d.ts +7 -43
- package/dist/vite.mjs +18 -131
- package/dist/vite.mjs.map +1 -1
- package/package.json +2 -12
- package/schema/extension-v2.json +121 -440
- package/dist/chunk-2CY5HVY7.mjs +0 -59
- package/dist/chunk-2CY5HVY7.mjs.map +0 -1
- package/dist/chunk-7YKH4LZN.cjs.map +0 -1
- package/dist/chunk-A74HCO6T.cjs.map +0 -1
- package/dist/chunk-BPCGXXMD.cjs.map +0 -1
- package/dist/chunk-EB5XWQAU.cjs +0 -132
- package/dist/chunk-EB5XWQAU.cjs.map +0 -1
- package/dist/chunk-GAUZYBXE.cjs.map +0 -1
- package/dist/chunk-KZ5NGFUP.mjs.map +0 -1
- package/dist/chunk-O357OJXL.cjs.map +0 -1
- package/dist/chunk-ONJMPO3P.cjs +0 -59
- package/dist/chunk-ONJMPO3P.cjs.map +0 -1
- package/dist/chunk-QJMZRV7A.mjs +0 -132
- package/dist/chunk-QJMZRV7A.mjs.map +0 -1
- package/dist/chunk-QXD7WVKK.mjs.map +0 -1
- package/dist/chunk-SGCYEEXD.mjs.map +0 -1
- package/dist/chunk-SGEYDV3K.mjs.map +0 -1
- package/dist/chunk-SLGOHIBL.mjs.map +0 -1
- package/dist/chunk-SWG7CNTZ.mjs.map +0 -1
- package/dist/client-BO3kavn0.d.ts +0 -25
- package/dist/client-DE-vMgdO.d.cts +0 -25
- package/dist/ui/styles.css +0 -740
- package/dist/ui.cjs +0 -1018
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.d.cts +0 -231
- package/dist/ui.d.ts +0 -231
- package/dist/ui.mjs +0 -1018
- package/dist/ui.mjs.map +0 -1
- package/dist/vite-preview-bootstrap.cjs +0 -66
- package/dist/vite-preview-bootstrap.cjs.map +0 -1
- package/dist/vite-preview-bootstrap.d.cts +0 -15
- package/dist/vite-preview-bootstrap.d.ts +0 -15
- package/dist/vite-preview-bootstrap.mjs +0 -66
- package/dist/vite-preview-bootstrap.mjs.map +0 -1
- package/dist/work-events-BlOVpK0k.d.ts +0 -547
- package/dist/work-events-D97EoqvS.d.cts +0 -547
- /package/dist/{chunk-RBIQT75L.mjs.map → chunk-GG3IX52W.mjs.map} +0 -0
package/dist/vite-preview.cjs
CHANGED
|
@@ -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
|
|
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
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkNFUPPCX4cjs = require('./chunk-NFUPPCX4.cjs');
|
|
13
|
+
require('./chunk-5AAPD5WV.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
21
|
-
require('./chunk-
|
|
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
|
|
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
|
-
"./
|
|
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: { ...
|
|
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, -
|
|
409
|
-
background: #
|
|
410
|
-
color: #
|
|
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;
|
|
398
|
+
body { margin: 0; min-width: 320px; }
|
|
416
399
|
button, select { font: inherit; }
|
|
417
|
-
.tap-preview {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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
|
|
454
|
-
.tap-preview-
|
|
455
|
-
.tap-preview-
|
|
456
|
-
.tap-preview-
|
|
457
|
-
.tap-preview-
|
|
458
|
-
.tap-preview-
|
|
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-
|
|
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:
|
|
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 {
|
|
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: () =>
|
|
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',
|
|
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',
|
|
686
|
-
const loadKey = `${remote}|${_nullishCoalesce(_optionalChain([contribution, 'optionalAccess',
|
|
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
|
|
555
|
+
return _chunkNFUPPCX4cjs.createTapMock.call(void 0, {
|
|
718
556
|
extensionId: manifest.id,
|
|
719
557
|
extensionName: manifest.name,
|
|
720
|
-
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
|
|
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,
|
|
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, "
|
|
758
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "
|
|
759
|
-
|
|
760
|
-
|
|
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, "
|
|
768
|
-
|
|
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
|
-
"
|
|
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
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
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.
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
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
|
|