@braedonsaunders/appkit-forms 0.2.2
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/LICENSE +661 -0
- package/README.md +74 -0
- package/canvas-editor.d.ts +24 -0
- package/canvas-editor.d.ts.map +1 -0
- package/canvas-editor.js +115 -0
- package/canvas-editor.js.map +1 -0
- package/canvas-runtime.d.ts +12 -0
- package/canvas-runtime.d.ts.map +1 -0
- package/canvas-runtime.js +54 -0
- package/canvas-runtime.js.map +1 -0
- package/element-preview.d.ts +9 -0
- package/element-preview.d.ts.map +1 -0
- package/element-preview.js +167 -0
- package/element-preview.js.map +1 -0
- package/form-designer.d.ts +29 -0
- package/form-designer.d.ts.map +1 -0
- package/form-designer.js +214 -0
- package/form-designer.js.map +1 -0
- package/form-flow-validation.d.ts +5 -0
- package/form-flow-validation.d.ts.map +1 -0
- package/form-flow-validation.js +154 -0
- package/form-flow-validation.js.map +1 -0
- package/form-renderer.d.ts +37 -0
- package/form-renderer.d.ts.map +1 -0
- package/form-renderer.js +282 -0
- package/form-renderer.js.map +1 -0
- package/formula-builder.d.ts +25 -0
- package/formula-builder.d.ts.map +1 -0
- package/formula-builder.js +310 -0
- package/formula-builder.js.map +1 -0
- package/generated-copy.d.ts +17 -0
- package/generated-copy.d.ts.map +1 -0
- package/generated-copy.js +396 -0
- package/generated-copy.js.map +1 -0
- package/index.d.ts +27 -0
- package/index.d.ts.map +1 -0
- package/index.js +25 -0
- package/index.js.map +1 -0
- package/logic-builder.d.ts +27 -0
- package/logic-builder.d.ts.map +1 -0
- package/logic-builder.js +106 -0
- package/logic-builder.js.map +1 -0
- package/package.json +54 -0
- package/photo-field-state.d.ts +9 -0
- package/photo-field-state.d.ts.map +1 -0
- package/photo-field-state.js +11 -0
- package/photo-field-state.js.map +1 -0
- package/production-designer-adapter.d.ts +100 -0
- package/production-designer-adapter.d.ts.map +1 -0
- package/production-designer-adapter.js +2 -0
- package/production-designer-adapter.js.map +1 -0
- package/production-file-upload.d.ts +27 -0
- package/production-file-upload.d.ts.map +1 -0
- package/production-file-upload.js +105 -0
- package/production-file-upload.js.map +1 -0
- package/production-form-designer.d.ts +3 -0
- package/production-form-designer.d.ts.map +1 -0
- package/production-form-designer.js +1124 -0
- package/production-form-designer.js.map +1 -0
- package/production-form-renderer.d.ts +16 -0
- package/production-form-renderer.d.ts.map +1 -0
- package/production-form-renderer.js +2134 -0
- package/production-form-renderer.js.map +1 -0
- package/production-runtime-adapter.d.ts +187 -0
- package/production-runtime-adapter.d.ts.map +1 -0
- package/production-runtime-adapter.js +2 -0
- package/production-runtime-adapter.js.map +1 -0
- package/production-runtime-context.d.ts +29 -0
- package/production-runtime-context.d.ts.map +1 -0
- package/production-runtime-context.js +35 -0
- package/production-runtime-context.js.map +1 -0
- package/production-runtime-layout.d.ts +21 -0
- package/production-runtime-layout.d.ts.map +1 -0
- package/production-runtime-layout.js +33 -0
- package/production-runtime-layout.js.map +1 -0
- package/properties.d.ts +36 -0
- package/properties.d.ts.map +1 -0
- package/properties.js +133 -0
- package/properties.js.map +1 -0
- package/record-actions-panel.d.ts +28 -0
- package/record-actions-panel.d.ts.map +1 -0
- package/record-actions-panel.js +136 -0
- package/record-actions-panel.js.map +1 -0
- package/record-behavior-panel.d.ts +15 -0
- package/record-behavior-panel.d.ts.map +1 -0
- package/record-behavior-panel.js +59 -0
- package/record-behavior-panel.js.map +1 -0
- package/record-config.d.ts +44 -0
- package/record-config.d.ts.map +1 -0
- package/record-config.js +2 -0
- package/record-config.js.map +1 -0
- package/record-list-panel.d.ts +16 -0
- package/record-list-panel.d.ts.map +1 -0
- package/record-list-panel.js +86 -0
- package/record-list-panel.js.map +1 -0
- package/risk-matrix.d.ts +93 -0
- package/risk-matrix.d.ts.map +1 -0
- package/risk-matrix.js +239 -0
- package/risk-matrix.js.map +1 -0
- package/runtime-controls.d.ts +19 -0
- package/runtime-controls.d.ts.map +1 -0
- package/runtime-controls.js +61 -0
- package/runtime-controls.js.map +1 -0
- package/sketch-pad-client.d.ts +4 -0
- package/sketch-pad-client.d.ts.map +1 -0
- package/sketch-pad-client.js +54 -0
- package/sketch-pad-client.js.map +1 -0
- package/sketch-pad.d.ts +13 -0
- package/sketch-pad.d.ts.map +1 -0
- package/sketch-pad.js +17 -0
- package/sketch-pad.js.map +1 -0
- package/styles.css +7 -0
- package/text.d.ts +5 -0
- package/text.d.ts.map +1 -0
- package/text.js +10 -0
- package/text.js.map +1 -0
- package/workflow-properties.d.ts +16 -0
- package/workflow-properties.d.ts.map +1 -0
- package/workflow-properties.js +31 -0
- package/workflow-properties.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-copy.js","sourceRoot":"","sources":["../src/generated-copy.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,OAAO,CAAA;AAEd,MAAM,IAAI,GAA2B;IACnC,kBAAkB,EAAE,0CAA0C;IAC9D,kBAAkB,EAAE,eAAe;IACnC,kBAAkB,EAAE,aAAa;IACjC,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,cAAc;IAClC,kBAAkB,EAAE,2CAA2C;IAC/D,kBAAkB,EAAE,aAAa;IACjC,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,MAAM;IAC1B,kBAAkB,EAAE,6BAA6B;IACjD,kBAAkB,EAAE,sDAAsD;IAC1E,kBAAkB,EAAE,sBAAsB;IAC1C,kBAAkB,EAAE,MAAM;IAC1B,kBAAkB,EAAE,2CAA2C;IAC/D,kBAAkB,EAAE,cAAc;IAClC,kBAAkB,EAAE,cAAc;IAClC,kBAAkB,EAAE,gCAAgC;IACpD,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,YAAY;IAChC,kBAAkB,EAAE,4BAA4B;IAChD,kBAAkB,EAAE,2BAA2B;IAC/C,kBAAkB,EAAE,oCAAoC;IACxD,k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,OAAO,4BAAG,SAAS,CAAC,KAAK,CAAC,GAAI,CAAA;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,MAAgC;IAClE,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,KAAK,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QAC9D,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAA;IACxE,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n type ReactNode,\n} from 'react'\n\nconst COPY: Record<string, string> = {\n \"m_0027988a09362c\": \"Location is not available on this device\",\n \"m_0079038e85c06d\": \"Remove marker\",\n \"m_00cfcb628bc131\": \"Submitting…\",\n \"m_00ded356f0f424\": \"s\",\n \"m_00e704d1194796\": \"of\",\n \"m_011434db59926f\": \"↳ auto-fills\",\n \"m_013e7516f5d2ac\": \"severity. Select the cell again to clear.\",\n \"m_01711e3b6ef4b1\": \"No concerns\",\n \"m_01f47383f19f8c\": \"I\",\n \"m_020146dd3d3d5a\": \"Site\",\n \"m_0289ca8aa7b891\": \"flags missing PPE + hazards\",\n \"m_02961df16c552c\": \"Tap the photo to drop a numbered marker on a hazard.\",\n \"m_02c65c639b006d\": \"No matching records.\",\n \"m_0301e90977d549\": \"Base\",\n \"m_030778daefe8eb\": \"Computed value — recomputed automatically\",\n \"m_031b307596badd\": \"Row {value0}\",\n \"m_033fc0f555f2d1\": \"likelihood ×\",\n \"m_03a7728b77e19a\": \"Add a comment (required on No)\",\n \"m_03d716fddcdd92\": \"B\",\n \"m_03e83706cf8b10\": \"Analyzing…\",\n \"m_04b7380779afc4\": \"Example repeating sections\",\n \"m_04c0e447e102e8\": \"This tab has no sections.\",\n \"m_04f68a7a34cfe6\": \"No PPE issues or hazards detected.\",\n \"m_051735b7305b06\": \"Fix {value0} issue{value1} before continuing\",\n \"m_051fb158550e48\": \"Submit failed\",\n \"m_0535300396f0de\": \"Re-analyze\",\n \"m_05829ac350a185\": \"This entry is {value0}. You don't have permission to edit it.\",\n \"m_05a0e2d38bded7\": \"sign here\",\n \"m_05b9318155a4da\": \"Decimal places\",\n \"m_05f4e3346f9aec\": \"AI-generated — verify before acting.\",\n \"m_068bf7c4eb45a2\": \"Add operand\",\n \"m_071d6ce8114c46\": \"Select the previous field first…\",\n \"m_0731204fbd1b17\": \"Save failed\",\n \"m_07c67e89962d16\": \"Preview ·\",\n \"m_07cd022cc38d60\": \"Capture location\",\n \"m_0839e554b28c58\": \"Loading canvas…\",\n \"m_08824e0636c702\": \"Configure a data source…\",\n \"m_0889ad146e26ca\": \"Stop\",\n \"m_08b5fa148b2af7\": \"Next\",\n \"m_08ff35b4e882af\": \"Add rows and a scale to this grid in the element settings.\",\n \"m_099ccdb4b80d5d\": \"Type your full name\",\n \"m_09a3fb77851262\": \"Separator\",\n \"m_09ee2ce911f04f\": \"Submit\",\n \"m_09f3fc442fedaf\": \"State / region\",\n \"m_0a3bcf685192f1\": \"Saved ✓\",\n \"m_0a43fb83c91fdf\": \"Scan or type a code\",\n \"m_0a8b09bc1dafbb\": \"Select risk rating\",\n \"m_0addbe9f7bc1a1\": \"Back to assessment\",\n \"m_0b3f2e42d2d097\": \"Add person…\",\n \"m_0b4d2076c64fbb\": \"Replace photo\",\n \"m_0b628e024bdff1\": \"Previous\",\n \"m_0b842b664b4f3b\": \"Search people…\",\n \"m_0bae7689763970\": \"Draft restored — pick up where you left off\",\n \"m_0bcab596e5288c\": \"Update location\",\n \"m_0be39d3a196b5b\": \"Select a person…\",\n \"m_0c388e73463aaf\": \"High-contrast field mode\",\n \"m_0c726da8b78d42\": \"No results\",\n \"m_0c75ca758719d2\": \"When (condition)\",\n \"m_0ca96ade46371f\": \"Add options to rank (Element → Options).\",\n \"m_0cd6abb2df6fc8\": \"View only\",\n \"m_0d0facbd71aa6a\": \"Type your name to attest\",\n \"m_0d4127eb7af91b\": \"Right\",\n \"m_0d90d1eceb566b\": \"table\",\n \"m_0e315ebf127b18\": \"Review\",\n \"m_0e65697ec32c03\": \"Loading…\",\n \"m_0e6eb1d4f48e48\": \"Remove element\",\n \"m_0e814cfafd9944\": \"· {value0} rows\",\n \"m_0e96f06e9f8960\": \"This table has no columns configured.\",\n \"m_0f20f0bc8118a7\": \"Save failed — retry\",\n \"m_0f8706f757eeb9\": \"City\",\n \"m_0fe28938af7e45\": \"Annotate hazards\",\n \"m_0fec93e95858fc\": \"Analyze for hazards\",\n \"m_101f98a70352fa\": \"Remove {value0}\",\n \"m_106811f2aac664\": \"Saving…\",\n \"m_10e50435ff2693\": \"+ upload\",\n \"m_10f4f461b6e849\": \"Degree (2 = √, 3 = ∛)\",\n \"m_1129f239fbb89a\": \"Select…\",\n \"m_114202332342ab\": \"{value0} risk\",\n \"m_119e08753a396f\": \"No rows yet.\",\n \"m_1217fe2f6bac7c\": \"At least {value0} required.\",\n \"m_126f736e7419f7\": \"No rows.\",\n \"m_1287c1049195af\": \"• List\",\n \"m_12a3f895c3506c\": \"Increase\",\n \"m_12b310a027b08a\": \"Remove row\",\n \"m_13a874065f07f8\": \"Search {value0}s…\",\n \"m_13b78c61dbb517\": \"Not saved — retry\",\n \"m_13c9eb2e75e0da\": \"Address line 1\",\n \"m_13e61f4185333d\": \"Not rated\",\n \"m_146f7d831bfd96\": \"Left\",\n \"m_1480a378beafd1\": \"v{value0}\",\n \"m_14ab8cefda3cf9\": \"Move down\",\n \"m_14c3dfbc8a08e9\": \"{value0} · v{value1}\",\n \"m_14dac40a7e102a\": \"row {value0} {value1}\",\n \"m_15ca343c0669d7\": \"No compatible picker fields in this template. Add a person, customer, project, site, or area picker first.\",\n \"m_15f748343d3956\": \"count\",\n \"m_168fba897c5202\": \"Hazards\",\n \"m_16a715c725d406\": \"S\",\n \"m_16bca608598e31\": \"Where this is being recorded\",\n \"m_16c009976e0b86\": \"Drag elements here from the left panel\",\n \"m_16fb1210fc864b\": \"Marker {value0} — note\",\n \"m_170bba2afbd664\": \"· ±{value0}m\",\n \"m_171450f953a653\": \"You don't have permission to edit this entry.\",\n \"m_178de0c94da150\": \"Search an address…\",\n \"m_17cb3d26a75938\": \"Drag to move\",\n \"m_18010438ac7907\": \"+ photo\",\n \"m_182296d9886284\": \"Submit failed — see field errors\",\n \"m_182c889ab6dd96\": \"L\",\n \"m_18391e161b9ed6\": \"PPE\",\n \"m_18c006b02858b9\": \"tap photo to mark hazards\",\n \"m_195a8468f60956\": \"{value0} row {value1}\",\n \"m_196f872aa354d3\": \"Else\",\n \"m_1979ef2713c627\": \"Exponent\",\n \"m_197fef09772e0d\": \"Link\",\n \"m_1989eb71707ad3\": \"(no formula)\",\n \"m_198b8dba5a829c\": \"Scan\",\n \"m_19dc719a9038ec\": \"Use an HTTPS, email, phone, /path, or #anchor link.\",\n \"m_19e342351d140c\": \"Postal code\",\n \"m_19f38a950f87b6\": \"rows\",\n \"m_1a1dcc7d0b9e8a\": \"pick many\",\n \"m_1a4be3846f6837\": \"Select the cell where likelihood meets severity.\",\n \"m_1a66e46e2f8f21\": \"Could not get your location — check permissions\",\n \"m_1a7cefe5a9894e\": \"Back\",\n \"m_1a9d8d971b1edb\": \"Remove\",\n \"m_1abf555859c0a8\": \"draw / diagram here\",\n \"m_1aea6765cbbb07\": \"Then\",\n \"m_1b781270c0d2f5\": \"name@example.com\",\n \"m_1bbb2531ada8ce\": \"Decrease\",\n \"m_1bcca98c4d6c29\": \"Country\",\n \"m_1c34ceb10770ab\": \"Select the previous field first.\",\n \"m_1c693e59d64fb2\": \"v\",\n \"m_1cc0e5e7b5f442\": \"Value\",\n \"m_1cee12b0954a84\": \"No rows. Add one below.\",\n \"m_1d213acef86dbc\": \"Search records…\",\n \"m_1d33f094c621dc\": \"pick one\",\n \"m_1d3baabf618cbd\": \"Select {value0} {value1}…\",\n \"m_1d6aa8702d3fac\": \"field\",\n \"m_1d8a295c4b1d4b\": \"Could not save before navigation — will retry\",\n \"m_1de0dacba80c75\": \"Form submitted\",\n \"m_1e3a16a7c41097\": \"Example top-level values\",\n \"m_1e4d427e74e767\": \"Clear\",\n \"m_1e62e6d69a0d11\": \"Bold\",\n \"m_1eabd71bbc0199\": \"Add row\",\n \"m_1eba1a694e67d0\": \"Bulleted list\",\n \"m_1ec1460770eaa0\": \"Move up\",\n \"m_1ee96b6856cb45\": \"Italic\",\n \"m_1f07a454b7b05b\": \"Page\",\n \"m_1f2236b17eb1ef\": \"Showing {value0}–{value1} of {value2}\",\n \"m_1fa0b63118d05f\": \"No sections bound to this step. Submit to finalise.\",\n \"m_1fa9ced82f8b16\": \"Could not load records. Try again.\",\n \"m_001f1bfc6e0cd8\": \"Sign-off steps (\",\n \"m_003ae75549476b\": \"tab.\",\n \"m_008f5a3d7812ab\": \"No roles defined for this tenant.\",\n \"m_00b3d8649525da\": \"repeats. Variable repeats and alternate branches are not accepted.\",\n \"m_00c5b5a40a72f6\": \"Min rows\",\n \"m_00f78a864ff266\": \"Option\",\n \"m_0131c1cfaf2d5c\": \"[paragraph]\",\n \"m_018f962bfee661\": \"Limits displayed groups only. The aggregate still uses every matching record.\",\n \"m_01b66d9dba6889\": \"Publish v\",\n \"m_01c681f83ca98e\": \"Store (value)\",\n \"m_02043182fe57f9\": \"Drag onto the canvas, or click to add to the selected section.\",\n \"m_02193054995990\": \"interpolation from the row's values.\",\n \"m_024d5ac76425dc\": \"Show when (showIf)\",\n \"m_02529c1532db7a\": \"conditional\",\n \"m_025b2e6dff2c41\": \". Existing responses still render against the version they were submitted under.\",\n \"m_02890419bf69c5\": \"e.g. Load #{index+1}\",\n \"m_02a6c587f3d3fb\": \"label\",\n \"m_02b0a83932da4a\": \"Worker fills\",\n \"m_02ec964c87acae\": \"Records list\",\n \"m_02f67a0e8ba5ce\": \"section\",\n \"m_02ffe91f500dc8\": \"Signature required\",\n \"m_0316664a18ded7\": \"Required (validated)\",\n \"m_03363edf51ed99\": \"Range\",\n \"m_0342c212db3a34\": \"Advanced layout — position widgets freely on a grid (Appsmith / WordPress style)\",\n \"m_037b62ee03b335\": \"Sequential human stages on this form — different from Flows (automation)\",\n \"m_03be2202673df4\": \"Rows\",\n \"m_03f068cc4e9384\": \"Only show rows whose column matches the parent field's value — e.g. Area filtered by the chosen Site.\",\n \"m_04073463647168\": \"Publish v{value0}\",\n \"m_0444d7da46d928\": \"Assign\",\n \"m_044a5abd7d3ad4\": \"Option label\",\n \"m_044b4d57bb99ce\": \"Save access\",\n \"m_045d47c21e1cdf\": \"Live render of how the filler will see the form. Conditional logic is shown as chips; live filler runtime resolves them dynamically.\",\n \"m_0478595ea3a2da\": \"Element properties\",\n \"m_04eacfda3069db\": \"Columns\",\n \"m_059cd549852b55\": \"Add column\",\n \"m_0605fd789eea1e\": \"Remove column\",\n \"m_061739b5f07deb\": \"Short description of what changed\",\n \"m_0627e4bbe74939\": \"Canvas\",\n \"m_0664f38791aed8\": \"Workflow step (page)\",\n \"m_067480a82419f2\": \"Group by a column to render a chart; leave it blank for a single KPI number.\",\n \"m_06a6b6820d522d\": \"No options.\",\n \"m_06b9949f5fa1bc\": \"Display\",\n \"m_06e1ca227aca9b\": \"repeating\",\n \"m_074251897a5932\": \"Purpose and audience\",\n \"m_075f330b972a3b\": \"e.g. %, m, °C\",\n \"m_0776e7f56fd55a\": \"Literal default value\",\n \"m_078d7e637546f9\": \"Assignee value\",\n \"m_07f039d1ce81ec\": \"Builder\",\n \"m_0806911c39f2f6\": \"Max length\",\n \"m_08114bb9803f7d\": \"The basics shown across the app — its name and what it's for.\",\n \"m_089e71eb771aca\": \"Section ID (immutable)\",\n \"m_09249e0e6a801e\": \"Could not update sidebar\",\n \"m_095b70fae90c39\": \"Remove point\",\n \"m_0964f6e2cc4375\": \"Overview saved\",\n \"m_096d47f60747b3\": \"Compliance\",\n \"m_09750de58b1490\": \"No columns.\",\n \"m_0976c514f311fb\": \"Requiring people to fill this app — who, on what schedule, and tracking completion — is handled by the\",\n \"m_09aebdb43a47c7\": \"Delete (must keep at least one)\",\n \"m_09eea65fa736d3\": \"Unpin\",\n \"m_0a31fefe8144a2\": \"[options will appear here]\",\n \"m_0aa48682b14c95\": \"Give your app a name\",\n \"m_0ad38d3d51d13e\": \"Anyone with access can also open and fill this app directly from the gallery.\",\n \"m_0adae4a94c7be3\": \"Build\",\n \"m_0af1983403d12e\": \"Could not save\",\n \"m_0b04b904ce4f9a\": \"Drag to reorder\",\n \"m_0b120bda8434d5\": \"Build surface\",\n \"m_0b60657b166b0e\": \"Create an assignment\",\n \"m_0bb347c23433ea\": \"Filter by field\",\n \"m_0bf548b271dbc1\": \"automation — to send notifications, raise CAPAs, or branch on answers, use the\",\n \"m_0bff3b64e15427\": \"Field —\",\n \"m_0c072fb8baf115\": \"Publish\",\n \"m_0c528a939be441\": \"View all obligations\",\n \"m_0cc4443595b87e\": \"Sidebar\",\n \"m_0cd91fbbd3fca0\": \"Computed read-only value. Recomputes on every dependency change.\",\n \"m_0ce705b8fa979c\": \"Add step\",\n \"m_0cfd5e4e441158\": \"Add section\",\n \"m_0cfeced513f8d1\": \"Add tabs\",\n \"m_0cff7e37da2b3f\": \"Step\",\n \"m_0d04877b1a742b\": \"Help text\",\n \"m_0d067cf371aad1\": \"+ Row\",\n \"m_0d06d42b0344eb\": \"Entries\",\n \"m_0d25e53152dc0a\": \"Table setup\",\n \"m_0d31ecacb5b2ee\": \"Open · double-click to rename\",\n \"m_0d513924d97753\": \"Section\",\n \"m_0d523c82eb812b\": \"Data binding\",\n \"m_0d55cb5819a8ab\": \"Results per search\",\n \"m_0d6735f83b77a3\": \"No elements. Drag one from the left panel, or select an element to add it here.\",\n \"m_0db2c879ad4429\": \"Field is rendered only when all/any clauses match.\",\n \"m_0de21bd4fd99e9\": \"Applied on first render when this field is empty.\",\n \"m_0decefd558c355\": \"Title\",\n \"m_0e2a97913eb84b\": \"+ Mapping\",\n \"m_0e69ebb67d27c2\": \"Options\",\n \"m_0ea6ba70f4dcd9\": \"Supports\",\n \"m_0eced645981830\": \"Snapshot the current schema as a new immutable version.\",\n \"m_0f24da1a05270a\": \"Row label\",\n \"m_0f334abe43e80f\": \"Applies when the section has multiple columns.\",\n \"m_0f8b37ea44adb6\": \"[heading]\",\n \"m_0f92f0f3b0d515\": \"+ Point\",\n \"m_0fdf1d8380c89b\": \"Matched on column\",\n \"m_100639ca393959\": \"Min\",\n \"m_102bef82722058\": \"Aggregate\",\n \"m_102c6abe56e4d5\": \"Overview\",\n \"m_104e7b02f49d5e\": \"Content language\",\n \"m_10a741ad57253f\": \"Repeating section (user adds N rows)\",\n \"m_112e2e8ecda428\": \"Cancel\",\n \"m_1154a02825ffe0\": \"Manage sources ↗\",\n \"m_11773f3c3f7558\": \"Delete\",\n \"m_11933adf482cac\": \"step ·\",\n \"m_11d37007232de5\": \"Preview\",\n \"m_125586069a681f\": \"Copy a column from the picked row into another field.\",\n \"m_126c7eab8ac9fd\": \"{index}\",\n \"m_128e83250b7fc0\": \"Access\",\n \"m_12b32266eec3e2\": \"Publishing…\",\n \"m_12fe2fe7a9ddad\": \"Required\",\n \"m_1357113b889d93\": \"Fixed-format pattern\",\n \"m_13d7101bd1f531\": \"Element ID (immutable)\",\n \"m_13f79ee70f138d\": \"Record actions\",\n \"m_1411910c3561c0\": \"click to upload\",\n \"m_141aeed76d15ff\": \"Min length\",\n \"m_1452f24ba8370a\": \"Visible to everyone\",\n \"m_1457c1cce0b63c\": \"Tab\",\n \"m_147b61c2aef29b\": \"Key (immutable id)\",\n \"m_147c46b5f494d3\": \"Groups shown\",\n \"m_14b18c80af7bd4\": \"Selection\",\n \"m_14c557ff352d60\": \"Choose which roles can see and fill this app. Leave all unchecked to allow everyone. Admins always have access.\",\n \"m_14d923495cf14c\": \"Description\",\n \"m_14ea5fb193bdaf\": \"Width (columns)\",\n \"m_14efdd0bff7d70\": \"Supervisor signs\",\n \"m_155fd3bdb6e009\": \"Changelog\",\n \"m_157bc1fc2157b9\": \"Add option\",\n \"m_159e1e93b7e19d\": \"Predefined rows\",\n \"m_160787e531bffd\": \"Assignee kind\",\n \"m_160f2c28b65229\": \"Lists this app under\",\n \"m_1653ad0a199171\": \"Start with ^, end with $, and use exact\",\n \"m_165fbf2bc8254b\": \"Published v{value0}\",\n \"m_166da8c01a8107\": \"Of column\",\n \"m_16907e8a555a15\": \"e.g. ^[A-Z]{2}-[0-9]{4}$\",\n \"m_16b0d6e1ba7d5e\": \"Pin\",\n \"m_16ba74a70fdc2f\": \"Show (label)\",\n \"m_16c73b6230c543\": \"Failed to publish\",\n \"m_16d04782fa275d\": \"This snapshots the current schema as v\",\n \"m_16f11d7bc7b7b4\": \"Refresh\",\n \"m_16f13907f8a65a\": \"Columns shown\",\n \"m_16f4ae27da8dbb\": \"Save overview\",\n \"m_171519729cccb4\": \"Cascade (optional)\",\n \"m_1737e921e5c6c6\": \"Overrides the default validator message\",\n \"m_174bcc6db92052\": \"Advanced layout\",\n \"m_175ee59112fb66\": \"Group by\",\n \"m_17833f54b99d38\": \". Each step is assigned to a person and can require a signature; bind a section to a step in its properties. This is\",\n \"m_180fea01504577\": \"Applied — review and Publish when ready\",\n \"m_186d665b9052f3\": \"as a calculator or utility. Takes effect once the app is published.\",\n \"m_18a30dc84d2a64\": \"App name\",\n \"m_19241615edae92\": \"Unit (optional)\",\n \"m_1929e34b445f83\": \"Max\",\n \"m_194bb13d821775\": \"formula\",\n \"m_19589d12bcbbf9\": \"No data sources. Create one in Admin → Data sources.\",\n \"m_199de632ae64e0\": \"Max rows\",\n \"m_1a014cc338576c\": \"Custom error message\",\n \"m_1a11f78c7d99d8\": \"Sequential human stages of this form — e.g.\",\n \"m_1a19ebd22b2247\": \"Add an element\",\n \"m_1a3262f89c2c42\": \"{n}\",\n \"m_1a4786daa752b1\": \"Flows\",\n \"m_1aa941e2f78dc5\": \"Auto-fill on select\",\n \"m_1ab6807a4e8f9e\": \"Rows per page\",\n \"m_1acffe9b7aa3dd\": \"Step ·\",\n \"m_1b1fa20684f949\": \"Drag onto the canvas — or click to add to the selected section\",\n \"m_1b7cb35c4f57dd\": \"Split this app into tabs\",\n \"m_1bac81ba078d96\": \"engine.\",\n \"m_1bd1bb813826dc\": \"Scale\",\n \"m_1c1250c8c10a42\": \"Record behaviour\",\n \"m_1c2ad488291a89\": \"Immutable version\",\n \"m_1c39dfb38ad051\": \"The lookup searches the full source remotely and returns this many matches at a time.\",\n \"m_1c4a359175c7fa\": \"Row label template\",\n \"m_1c75ba367ef317\": \"Sign-off steps\",\n \"m_1c8658eb9347b4\": \"not\",\n \"m_1cc0241831296d\": \"Manager reviews\",\n \"m_1d19a02fd2872f\": \"key\",\n \"m_1d4f77715c6f3d\": \"Label (\",\n \"m_1d76a1713fe585\": \"Draft · published v\",\n \"m_1d82f43c88df4c\": \"Remove mapping\",\n \"m_1dadff0d2c2898\": \"Pin this app to the left sidebar for everyone in the workspace. Takes effect once the app is published.\",\n \"m_1ddad1532de2e3\": \"/tools\",\n \"m_1e018b65c95ffd\": \", and\",\n \"m_1e0a540071af99\": \"Elements flow left→right; set each element's width in its Basic tab.\",\n \"m_1e0a86199c09df\": \"AI\",\n \"m_1e28aaa8e490af\": \"How the filler will see this form.\",\n \"m_1e2be77312c5b8\": \"Column label\",\n \"m_1e42ea374d7063\": \"Access saved\",\n \"m_1e51e17fccd721\": \"Data source\",\n \"m_1e7fd6a7c790fe\": \"Add a tab\",\n \"m_1e888eaf9e8eed\": \"Stacked\",\n \"m_1e97527af4024b\": \"Delete section\",\n \"m_1ea646f0dcd3d5\": \"Title (\",\n \"m_1ed2cc27e05841\": \"value\",\n \"m_1ed8de977a458a\": \"{index+1}\",\n \"m_1ee65e14915cf1\": \"Columns (layout)\",\n \"m_1f008c56f09179\": \"Show in the Tools catalogue\",\n \"m_1f15a1cd1a64c4\": \"Formula\",\n \"m_1f688129a274f7\": \"Restricted to {value0} role{value1}\",\n \"m_1fad56c24b22ed\": \"{<fieldKey>}\",\n}\n\nconst KEY_BY_VALUE = new Map(Object.entries(COPY).map(([key, value]) => [value, key]))\n\nexport type GeneratedCopyTranslator = (\n key: string,\n defaultValue: string,\n values?: Record<string, unknown>,\n) => string\n\nconst GeneratedCopyContext = createContext<GeneratedCopyTranslator | null>(null)\n\nexport function resolveGeneratedCopy(key: string, values?: Record<string, unknown>): string {\n return interpolate(COPY[key] ?? key, values)\n}\n\nexport function GeneratedCopyProvider({\n translate,\n children,\n}: {\n translate?: GeneratedCopyTranslator\n children: ReactNode\n}) {\n return <GeneratedCopyContext.Provider value={translate ?? null}>{children}</GeneratedCopyContext.Provider>\n}\n\nexport function useGeneratedTranslations() {\n const translate = useContext(GeneratedCopyContext)\n return useCallback((key: string, values?: Record<string, unknown>) => {\n const fallback = COPY[key] ?? key\n return translate?.(key, fallback, values) ?? resolveGeneratedCopy(key, values)\n }, [translate])\n}\n\nexport function useGeneratedValueTranslations() {\n const translate = useGeneratedTranslations()\n return useCallback(<Value,>(value: Value): Value => {\n if (typeof value !== 'string') return value\n const key = KEY_BY_VALUE.get(value)\n return (key ? translate(key) : value) as Value\n }, [translate])\n}\n\nexport function GeneratedText({ id, values }: { id: string; values?: Record<string, unknown> }) {\n const translate = useGeneratedTranslations()\n return <>{translate(id, values)}</>\n}\n\nexport function GeneratedValue({ value }: { value: ReactNode }) {\n return typeof value === 'string' ? <TranslatedGeneratedValue value={value} /> : <>{value}</>\n}\n\nfunction TranslatedGeneratedValue({ value }: { value: string }) {\n const translate = useGeneratedValueTranslations()\n return <>{translate(value)}</>\n}\n\nfunction interpolate(value: string, values?: Record<string, unknown>): string {\n let result = value\n for (const [key, replacement] of Object.entries(values ?? {})) {\n result = result.replaceAll('{' + key + '}', String(replacement ?? ''))\n }\n return result\n}\n"]}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { FormDesigner, createFormField, type FormDesignerProps, } from './form-designer.js';
|
|
2
|
+
export { ProductionFormDesigner, } from './production-form-designer.js';
|
|
3
|
+
export type { ProductionDesignerAssistantInput, ProductionDesignerFlowsInput, ProductionDesignerOverview, ProductionDesignerResult, ProductionFormDesignerAdapter, ProductionFormDesignerProps, ProductionFormKind, } from './production-designer-adapter.js';
|
|
4
|
+
export { formFlowProfile, lintFormFlowGraph } from './form-flow-validation.js';
|
|
5
|
+
export { FormRenderer, type FormRendererProps, type FormFieldAdapter, type FormFieldAdapterProps, type FormValues, } from './form-renderer.js';
|
|
6
|
+
export { LogicBuilder, type LogicBuilderLabels, } from './logic-builder.js';
|
|
7
|
+
export * from './formula-builder.js';
|
|
8
|
+
export * from './canvas-editor.js';
|
|
9
|
+
export * from './element-preview.js';
|
|
10
|
+
export * from './risk-matrix.js';
|
|
11
|
+
export * from './runtime-controls.js';
|
|
12
|
+
export * from './sketch-pad.js';
|
|
13
|
+
export * from './record-config.js';
|
|
14
|
+
export * from './record-behavior-panel.js';
|
|
15
|
+
export * from './record-list-panel.js';
|
|
16
|
+
export * from './record-actions-panel.js';
|
|
17
|
+
export * from './properties.js';
|
|
18
|
+
export * from './workflow-properties.js';
|
|
19
|
+
export { ProductionFormRenderer, type ProductionFormRendererProps, } from './production-form-renderer.js';
|
|
20
|
+
export { ProductionFormRuntimeProvider, useProductionFormRuntime, type ProductionRuntimeLabels, } from './production-runtime-context.js';
|
|
21
|
+
export type { ProductionDataAggregate, ProductionDataAggregateResult, ProductionDataColumn, ProductionDataQuery, ProductionDataQueryResult, ProductionDataRow, ProductionFormRuntimeAdapter, ProductionFormRuntimeInput, ProductionPhotoAnalysis, } from './production-runtime-adapter.js';
|
|
22
|
+
export { ProductionFileUpload, dataUrlToFile, type ProductionAttachedFile, type ProductionFileUploadProps, } from './production-file-upload.js';
|
|
23
|
+
export { ProductionSection, ProductionPremiumSection, type ProductionSectionProps, type ProductionPremiumSectionProps, type ProductionSectionTone, } from './production-runtime-layout.js';
|
|
24
|
+
export { canvasCss, columnsCss, gridClass, resolveCanvas } from './canvas-runtime.js';
|
|
25
|
+
export { attachmentIdsEqual, singlePrimaryPhoto } from './photo-field-state.js';
|
|
26
|
+
export { GeneratedCopyProvider, resolveGeneratedCopy, type GeneratedCopyTranslator, } from './generated-copy.js';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,sBAAsB,GACvB,MAAM,4BAA4B,CAAA;AACnC,YAAY,EACV,gCAAgC,EAChC,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAA"}
|
package/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { FormDesigner, createFormField, } from './form-designer.js';
|
|
2
|
+
export { ProductionFormDesigner, } from './production-form-designer.js';
|
|
3
|
+
export { formFlowProfile, lintFormFlowGraph } from './form-flow-validation.js';
|
|
4
|
+
export { FormRenderer, } from './form-renderer.js';
|
|
5
|
+
export { LogicBuilder, } from './logic-builder.js';
|
|
6
|
+
export * from './formula-builder.js';
|
|
7
|
+
export * from './canvas-editor.js';
|
|
8
|
+
export * from './element-preview.js';
|
|
9
|
+
export * from './risk-matrix.js';
|
|
10
|
+
export * from './runtime-controls.js';
|
|
11
|
+
export * from './sketch-pad.js';
|
|
12
|
+
export * from './record-config.js';
|
|
13
|
+
export * from './record-behavior-panel.js';
|
|
14
|
+
export * from './record-list-panel.js';
|
|
15
|
+
export * from './record-actions-panel.js';
|
|
16
|
+
export * from './properties.js';
|
|
17
|
+
export * from './workflow-properties.js';
|
|
18
|
+
export { ProductionFormRenderer, } from './production-form-renderer.js';
|
|
19
|
+
export { ProductionFormRuntimeProvider, useProductionFormRuntime, } from './production-runtime-context.js';
|
|
20
|
+
export { ProductionFileUpload, dataUrlToFile, } from './production-file-upload.js';
|
|
21
|
+
export { ProductionSection, ProductionPremiumSection, } from './production-runtime-layout.js';
|
|
22
|
+
export { canvasCss, columnsCss, gridClass, resolveCanvas } from './canvas-runtime.js';
|
|
23
|
+
export { attachmentIdsEqual, singlePrimaryPhoto } from './photo-field-state.js';
|
|
24
|
+
export { GeneratedCopyProvider, resolveGeneratedCopy, } from './generated-copy.js';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,GAEhB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,sBAAsB,GACvB,MAAM,4BAA4B,CAAA;AAUnC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EACL,YAAY,GAKb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,YAAY,GAEb,MAAM,iBAAiB,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,OAAO,EACL,sBAAsB,GAEvB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GAEzB,MAAM,8BAA8B,CAAA;AAYrC,OAAO,EACL,oBAAoB,EACpB,aAAa,GAGd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GAIzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GAErB,MAAM,kBAAkB,CAAA","sourcesContent":["export {\n FormDesigner,\n createFormField,\n type FormDesignerProps,\n} from './form-designer'\nexport {\n ProductionFormDesigner,\n} from './production-form-designer'\nexport type {\n ProductionDesignerAssistantInput,\n ProductionDesignerFlowsInput,\n ProductionDesignerOverview,\n ProductionDesignerResult,\n ProductionFormDesignerAdapter,\n ProductionFormDesignerProps,\n ProductionFormKind,\n} from './production-designer-adapter'\nexport { formFlowProfile, lintFormFlowGraph } from './form-flow-validation'\nexport {\n FormRenderer,\n type FormRendererProps,\n type FormFieldAdapter,\n type FormFieldAdapterProps,\n type FormValues,\n} from './form-renderer'\nexport {\n LogicBuilder,\n type LogicBuilderLabels,\n} from './logic-builder'\nexport * from './formula-builder'\nexport * from './canvas-editor'\nexport * from './element-preview'\nexport * from './risk-matrix'\nexport * from './runtime-controls'\nexport * from './sketch-pad'\nexport * from './record-config'\nexport * from './record-behavior-panel'\nexport * from './record-list-panel'\nexport * from './record-actions-panel'\nexport * from './properties'\nexport * from './workflow-properties'\nexport {\n ProductionFormRenderer,\n type ProductionFormRendererProps,\n} from './production-form-renderer'\nexport {\n ProductionFormRuntimeProvider,\n useProductionFormRuntime,\n type ProductionRuntimeLabels,\n} from './production-runtime-context'\nexport type {\n ProductionDataAggregate,\n ProductionDataAggregateResult,\n ProductionDataColumn,\n ProductionDataQuery,\n ProductionDataQueryResult,\n ProductionDataRow,\n ProductionFormRuntimeAdapter,\n ProductionFormRuntimeInput,\n ProductionPhotoAnalysis,\n} from './production-runtime-adapter'\nexport {\n ProductionFileUpload,\n dataUrlToFile,\n type ProductionAttachedFile,\n type ProductionFileUploadProps,\n} from './production-file-upload'\nexport {\n ProductionSection,\n ProductionPremiumSection,\n type ProductionSectionProps,\n type ProductionPremiumSectionProps,\n type ProductionSectionTone,\n} from './production-runtime-layout'\nexport { canvasCss, columnsCss, gridClass, resolveCanvas } from './canvas-runtime'\nexport { attachmentIdsEqual, singlePrimaryPhoto } from './photo-field-state'\nexport {\n GeneratedCopyProvider,\n resolveGeneratedCopy,\n type GeneratedCopyTranslator,\n} from './generated-copy'\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LogicRule } from '@braedonsaunders/appkit-forms-core';
|
|
2
|
+
export type LogicBuilderLabels = {
|
|
3
|
+
noFields: string;
|
|
4
|
+
heading: string;
|
|
5
|
+
alwaysVisible: string;
|
|
6
|
+
allOf: string;
|
|
7
|
+
anyOf: string;
|
|
8
|
+
addClause: string;
|
|
9
|
+
removeClause: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Two-mode logic editor:
|
|
13
|
+
* - "all"/"any" combinator over a flat list of clauses (simple, covers ~90%)
|
|
14
|
+
* - "raw JSON" fallback for nested/advanced rules
|
|
15
|
+
*/
|
|
16
|
+
export declare function LogicBuilder({ rule, availableFields, onChange, labels: labelsProp, className, disabled, }: {
|
|
17
|
+
rule: LogicRule | undefined;
|
|
18
|
+
availableFields: {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}[];
|
|
22
|
+
onChange: (rule: LogicRule | undefined) => void;
|
|
23
|
+
labels?: Partial<LogicBuilderLabels>;
|
|
24
|
+
className?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=logic-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic-builder.d.ts","sourceRoot":"","sources":["../src/logic-builder.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAoDD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,eAAe,EACf,QAAQ,EACR,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,QAAgB,GACjB,EAAE;IACD,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;IAC3B,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAChD,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAA;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,+BAgIA"}
|
package/logic-builder.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Plus, Trash2 } from 'lucide-react';
|
|
4
|
+
import { Button, Input, Select, cn } from '@braedonsaunders/appkit-ui';
|
|
5
|
+
const DEFAULT_LABELS = {
|
|
6
|
+
noFields: 'No other fields to reference.',
|
|
7
|
+
heading: 'Show when',
|
|
8
|
+
alwaysVisible: 'Always visible.',
|
|
9
|
+
allOf: 'all of',
|
|
10
|
+
anyOf: 'any of',
|
|
11
|
+
addClause: 'Add clause',
|
|
12
|
+
removeClause: 'Remove clause',
|
|
13
|
+
};
|
|
14
|
+
const OPS = [
|
|
15
|
+
{ value: 'eq', label: 'equals', takesValue: true },
|
|
16
|
+
{ value: 'ne', label: 'does not equal', takesValue: true },
|
|
17
|
+
{ value: 'gt', label: 'greater than', takesValue: true },
|
|
18
|
+
{ value: 'lt', label: 'less than', takesValue: true },
|
|
19
|
+
{ value: 'gte', label: '≥', takesValue: true },
|
|
20
|
+
{ value: 'lte', label: '≤', takesValue: true },
|
|
21
|
+
{ value: 'in', label: 'is one of (comma-sep)', takesValue: true },
|
|
22
|
+
{ value: 'notIn', label: 'is none of', takesValue: true },
|
|
23
|
+
{ value: 'isSet', label: 'has any value', takesValue: false },
|
|
24
|
+
{ value: 'isNotSet', label: 'is empty', takesValue: false },
|
|
25
|
+
];
|
|
26
|
+
// The forms-core schema requires `in`/`notIn` values to be ARRAYS (the
|
|
27
|
+
// evaluator does `rule.value.includes(v)`; a raw string would silently give
|
|
28
|
+
// substring semantics and fail schema validation on publish). The editor keeps
|
|
29
|
+
// the comma-separated affordance but stores the split array.
|
|
30
|
+
function coerceClauseValue(op, raw) {
|
|
31
|
+
if (op === 'in' || op === 'notIn') {
|
|
32
|
+
const text = Array.isArray(raw) ? raw.map((v) => String(v)).join(', ') : String(raw ?? '');
|
|
33
|
+
return text.split(',').map((s) => s.trim());
|
|
34
|
+
}
|
|
35
|
+
return Array.isArray(raw) ? raw.map((v) => String(v)).join(', ') : (raw ?? '');
|
|
36
|
+
}
|
|
37
|
+
function displayClauseValue(raw) {
|
|
38
|
+
if (Array.isArray(raw))
|
|
39
|
+
return raw.map((v) => String(v)).join(', ');
|
|
40
|
+
return String(raw ?? '');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Two-mode logic editor:
|
|
44
|
+
* - "all"/"any" combinator over a flat list of clauses (simple, covers ~90%)
|
|
45
|
+
* - "raw JSON" fallback for nested/advanced rules
|
|
46
|
+
*/
|
|
47
|
+
export function LogicBuilder({ rule, availableFields, onChange, labels: labelsProp, className, disabled = false, }) {
|
|
48
|
+
const labels = { ...DEFAULT_LABELS, ...labelsProp };
|
|
49
|
+
const { combinator, clauses } = normalize(rule);
|
|
50
|
+
function setCombinator(next) {
|
|
51
|
+
if (clauses.length === 0)
|
|
52
|
+
onChange(undefined);
|
|
53
|
+
else if (clauses.length === 1)
|
|
54
|
+
onChange(clauses[0]);
|
|
55
|
+
else
|
|
56
|
+
onChange({ op: next, rules: clauses });
|
|
57
|
+
}
|
|
58
|
+
function updateClause(i, patch) {
|
|
59
|
+
const next = clauses.map((c, j) => j === i ? { ...c, ...patch } : c);
|
|
60
|
+
emit(combinator, next);
|
|
61
|
+
}
|
|
62
|
+
function addClause() {
|
|
63
|
+
const first = availableFields[0]?.id ?? '';
|
|
64
|
+
if (!first)
|
|
65
|
+
return;
|
|
66
|
+
emit(combinator, [...clauses, { op: 'eq', field: first, value: '' }]);
|
|
67
|
+
}
|
|
68
|
+
function removeClause(i) {
|
|
69
|
+
emit(combinator, clauses.filter((_, j) => j !== i));
|
|
70
|
+
}
|
|
71
|
+
function emit(comb, list) {
|
|
72
|
+
if (list.length === 0)
|
|
73
|
+
onChange(undefined);
|
|
74
|
+
else if (list.length === 1)
|
|
75
|
+
onChange(list[0]);
|
|
76
|
+
else
|
|
77
|
+
onChange({ op: comb, rules: list });
|
|
78
|
+
}
|
|
79
|
+
if (availableFields.length === 0) {
|
|
80
|
+
return (_jsx("p", { className: "text-xs text-fg-muted", children: labels.noFields }));
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs("div", { className: cn('space-y-2 rounded-md border border-border bg-bg-subtle p-2', className), children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-xs font-semibold text-fg-muted", children: labels.heading }), _jsxs(Select, { className: "h-7 w-24 text-xs", value: combinator, disabled: disabled, onChange: (e) => setCombinator(e.target.value), children: [_jsx("option", { value: "and", children: labels.allOf }), _jsx("option", { value: "or", children: labels.anyOf })] })] }), clauses.length === 0 ? (_jsx("p", { className: "text-xs text-fg-muted", children: labels.alwaysVisible })) : (_jsx("ul", { className: "space-y-1.5", children: clauses.map((c, i) => {
|
|
83
|
+
const clause = c;
|
|
84
|
+
const opMeta = OPS.find((o) => o.value === clause.op);
|
|
85
|
+
return (_jsxs("li", { className: "flex items-center gap-1", children: [_jsx(Select, { className: "h-8 flex-1 text-xs", value: clause.field, disabled: disabled, onChange: (e) => updateClause(i, { field: e.target.value }), children: availableFields.map((f) => (_jsxs("option", { value: f.id, children: [f.label, " (", f.id, ")"] }, f.id))) }), _jsx(Select, { className: "h-8 w-28 text-xs", value: clause.op, disabled: disabled, onChange: (e) => {
|
|
86
|
+
const nextOp = e.target.value;
|
|
87
|
+
updateClause(i, {
|
|
88
|
+
op: nextOp,
|
|
89
|
+
value: OPS.find((o) => o.value === nextOp)?.takesValue
|
|
90
|
+
? coerceClauseValue(nextOp, clause.value)
|
|
91
|
+
: undefined,
|
|
92
|
+
});
|
|
93
|
+
}, children: OPS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) }), opMeta?.takesValue ? (_jsx(Input, { className: "h-8 flex-1 text-xs", value: displayClauseValue(clause.value), disabled: disabled, onChange: (e) => updateClause(i, {
|
|
94
|
+
value: coerceClauseValue(clause.op, e.target.value),
|
|
95
|
+
}) })) : null, _jsx("button", { type: "button", disabled: disabled, onClick: () => removeClause(i), "aria-label": labels.removeClause, className: "text-fg-subtle hover:text-danger disabled:cursor-not-allowed disabled:opacity-50", children: _jsx(Trash2, { size: 12 }) })] }, i));
|
|
96
|
+
}) })), _jsxs(Button, { size: "sm", variant: "outline", disabled: disabled, onClick: addClause, children: [_jsx(Plus, { size: 12 }), " ", labels.addClause] })] }));
|
|
97
|
+
}
|
|
98
|
+
function normalize(rule) {
|
|
99
|
+
if (!rule)
|
|
100
|
+
return { combinator: 'and', clauses: [] };
|
|
101
|
+
if ('rules' in rule && (rule.op === 'and' || rule.op === 'or')) {
|
|
102
|
+
return { combinator: rule.op, clauses: rule.rules };
|
|
103
|
+
}
|
|
104
|
+
return { combinator: 'and', clauses: [rule] };
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=logic-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic-builder.js","sourceRoot":"","sources":["../src/logic-builder.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAA;AAatE,MAAM,cAAc,GAAuB;IACzC,QAAQ,EAAE,+BAA+B;IACzC,OAAO,EAAE,WAAW;IACpB,aAAa,EAAE,iBAAiB;IAChC,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,YAAY;IACvB,YAAY,EAAE,eAAe;CAC9B,CAAA;AAED,MAAM,GAAG,GAIH;IACJ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE;IAClD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1D,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE;IACxD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE;IACrD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE;IAC9C,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GA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AAE,QAAQ,EAAE,OAAO,EAAE,SAAS,aACxE,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,GAAI,OAAE,MAAM,CAAC,SAAS,IAC7B,IACL,CACP,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAA2B;IAI5C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;IACpD,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC/D,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACrD,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAA;AAC/C,CAAC","sourcesContent":["'use client'\n\nimport { Plus, Trash2 } from 'lucide-react'\nimport { Button, Input, Select, cn } from '@braedonsaunders/appkit-ui'\nimport type { LogicRule } from '@braedonsaunders/appkit-forms-core'\n\nexport type LogicBuilderLabels = {\n noFields: string\n heading: string\n alwaysVisible: string\n allOf: string\n anyOf: string\n addClause: string\n removeClause: string\n}\n\nconst DEFAULT_LABELS: LogicBuilderLabels = {\n noFields: 'No other fields to reference.',\n heading: 'Show when',\n alwaysVisible: 'Always visible.',\n allOf: 'all of',\n anyOf: 'any of',\n addClause: 'Add clause',\n removeClause: 'Remove clause',\n}\n\nconst OPS: {\n value: LogicRule extends infer R ? (R extends { op: string } ? R['op'] : never) : never\n label: string\n takesValue: boolean\n}[] = [\n { value: 'eq', label: 'equals', takesValue: true },\n { value: 'ne', label: 'does not equal', takesValue: true },\n { value: 'gt', label: 'greater than', takesValue: true },\n { value: 'lt', label: 'less than', takesValue: true },\n { value: 'gte', label: '≥', takesValue: true },\n { value: 'lte', label: '≤', takesValue: true },\n { value: 'in', label: 'is one of (comma-sep)', takesValue: true },\n { value: 'notIn', label: 'is none of', takesValue: true },\n { value: 'isSet', label: 'has any value', takesValue: false },\n { value: 'isNotSet', label: 'is empty', takesValue: false },\n]\n\ntype SimpleRule = {\n op: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'notIn' | 'isSet' | 'isNotSet'\n field: string\n value?: unknown\n}\n\n// The forms-core schema requires `in`/`notIn` values to be ARRAYS (the\n// evaluator does `rule.value.includes(v)`; a raw string would silently give\n// substring semantics and fail schema validation on publish). The editor keeps\n// the comma-separated affordance but stores the split array.\nfunction coerceClauseValue(op: SimpleRule['op'], raw: unknown): unknown {\n if (op === 'in' || op === 'notIn') {\n const text = Array.isArray(raw) ? raw.map((v) => String(v)).join(', ') : String(raw ?? '')\n return text.split(',').map((s) => s.trim())\n }\n return Array.isArray(raw) ? raw.map((v) => String(v)).join(', ') : (raw ?? '')\n}\n\nfunction displayClauseValue(raw: unknown): string {\n if (Array.isArray(raw)) return raw.map((v) => String(v)).join(', ')\n return String(raw ?? '')\n}\n\n/**\n * Two-mode logic editor:\n * - \"all\"/\"any\" combinator over a flat list of clauses (simple, covers ~90%)\n * - \"raw JSON\" fallback for nested/advanced rules\n */\nexport function LogicBuilder({\n rule,\n availableFields,\n onChange,\n labels: labelsProp,\n className,\n disabled = false,\n}: {\n rule: LogicRule | undefined\n availableFields: { id: string; label: string }[]\n onChange: (rule: LogicRule | undefined) => void\n labels?: Partial<LogicBuilderLabels>\n className?: string\n disabled?: boolean\n}) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp }\n const { combinator, clauses } = normalize(rule)\n\n function setCombinator(next: 'and' | 'or') {\n if (clauses.length === 0) onChange(undefined)\n else if (clauses.length === 1) onChange(clauses[0])\n else onChange({ op: next, rules: clauses })\n }\n\n function updateClause(i: number, patch: Partial<SimpleRule>) {\n const next = clauses.map((c, j) =>\n j === i ? ({ ...(c as SimpleRule), ...patch } as LogicRule) : c,\n )\n emit(combinator, next)\n }\n\n function addClause() {\n const first = availableFields[0]?.id ?? ''\n if (!first) return\n emit(combinator, [...clauses, { op: 'eq', field: first, value: '' } as LogicRule])\n }\n\n function removeClause(i: number) {\n emit(\n combinator,\n clauses.filter((_, j) => j !== i),\n )\n }\n\n function emit(comb: 'and' | 'or', list: LogicRule[]) {\n if (list.length === 0) onChange(undefined)\n else if (list.length === 1) onChange(list[0])\n else onChange({ op: comb, rules: list })\n }\n\n if (availableFields.length === 0) {\n return (\n <p className=\"text-xs text-fg-muted\">{labels.noFields}</p>\n )\n }\n\n return (\n <div className={cn('space-y-2 rounded-md border border-border bg-bg-subtle p-2', className)}>\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-xs font-semibold text-fg-muted\">{labels.heading}</span>\n <Select\n className=\"h-7 w-24 text-xs\"\n value={combinator}\n disabled={disabled}\n onChange={(e) => setCombinator(e.target.value as 'and' | 'or')}\n >\n <option value=\"and\">{labels.allOf}</option>\n <option value=\"or\">{labels.anyOf}</option>\n </Select>\n </div>\n {clauses.length === 0 ? (\n <p className=\"text-xs text-fg-muted\">{labels.alwaysVisible}</p>\n ) : (\n <ul className=\"space-y-1.5\">\n {clauses.map((c, i) => {\n const clause = c as SimpleRule\n const opMeta = OPS.find((o) => o.value === clause.op)\n return (\n <li key={i} className=\"flex items-center gap-1\">\n <Select\n className=\"h-8 flex-1 text-xs\"\n value={clause.field}\n disabled={disabled}\n onChange={(e) => updateClause(i, { field: e.target.value })}\n >\n {availableFields.map((f) => (\n <option key={f.id} value={f.id}>\n {f.label} ({f.id})\n </option>\n ))}\n </Select>\n <Select\n className=\"h-8 w-28 text-xs\"\n value={clause.op}\n disabled={disabled}\n onChange={(e) => {\n const nextOp = e.target.value as SimpleRule['op']\n updateClause(i, {\n op: nextOp,\n value: OPS.find((o) => o.value === nextOp)?.takesValue\n ? coerceClauseValue(nextOp, clause.value)\n : undefined,\n })\n }}\n >\n {OPS.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </Select>\n {opMeta?.takesValue ? (\n <Input\n className=\"h-8 flex-1 text-xs\"\n value={displayClauseValue(clause.value)}\n disabled={disabled}\n onChange={(e) =>\n updateClause(i, {\n value: coerceClauseValue(clause.op, e.target.value),\n })\n }\n />\n ) : null}\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => removeClause(i)}\n aria-label={labels.removeClause}\n className=\"text-fg-subtle hover:text-danger disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Trash2 size={12} />\n </button>\n </li>\n )\n })}\n </ul>\n )}\n <Button size=\"sm\" variant=\"outline\" disabled={disabled} onClick={addClause}>\n <Plus size={12} /> {labels.addClause}\n </Button>\n </div>\n )\n}\n\nfunction normalize(rule: LogicRule | undefined): {\n combinator: 'and' | 'or'\n clauses: LogicRule[]\n} {\n if (!rule) return { combinator: 'and', clauses: [] }\n if ('rules' in rule && (rule.op === 'and' || rule.op === 'or')) {\n return { combinator: rule.op, clauses: rule.rules }\n }\n return { combinator: 'and', clauses: [rule] }\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@braedonsaunders/appkit-forms",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Production form designer, workflow authoring bridge, and complete fill runtime for AppKit applications.",
|
|
5
|
+
"license": "AGPL-3.0-or-later",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"import": "./index.js",
|
|
14
|
+
"default": "./index.js"
|
|
15
|
+
},
|
|
16
|
+
"./styles.css": "./styles.css",
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"main": "./index.js",
|
|
20
|
+
"types": "./index.d.ts",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@braedonsaunders/appkit-editor": "^0.2.2",
|
|
23
|
+
"@braedonsaunders/appkit-forms-core": "^0.1.1",
|
|
24
|
+
"@braedonsaunders/appkit-i18n": "^0.1.1",
|
|
25
|
+
"@braedonsaunders/appkit-tokens": "^0.1.2",
|
|
26
|
+
"@braedonsaunders/appkit-ui": "^0.2.0",
|
|
27
|
+
"@excalidraw/excalidraw": "^0.18.0",
|
|
28
|
+
"framer-motion": "^12.42.2",
|
|
29
|
+
"lucide-react": "^1.24.0",
|
|
30
|
+
"react-grid-layout": "^2.2.3"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^19.0.0",
|
|
34
|
+
"react-dom": "^19.0.0"
|
|
35
|
+
},
|
|
36
|
+
"author": "Braedon Saunders",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/braedonsaunders/appkit.git",
|
|
40
|
+
"directory": "packages/forms"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/braedonsaunders/appkit/tree/main/packages/forms#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/braedonsaunders/appkit/issues"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"appkit",
|
|
51
|
+
"application-framework",
|
|
52
|
+
"typescript"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type AttachmentIdentity = {
|
|
2
|
+
attachmentId: string;
|
|
3
|
+
};
|
|
4
|
+
/** True only when the ordered attachment identities are unchanged. */
|
|
5
|
+
export declare function attachmentIdsEqual(current: readonly AttachmentIdentity[], next: readonly AttachmentIdentity[]): boolean;
|
|
6
|
+
/** Photo annotation intentionally owns exactly one primary photo. */
|
|
7
|
+
export declare function singlePrimaryPhoto<T extends AttachmentIdentity>(files: readonly T[]): T[];
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=photo-field-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo-field-state.d.ts","sourceRoot":"","sources":["../src/photo-field-state.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAA;AAElD,sEAAsE;AACtE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,kBAAkB,EAAE,EACtC,IAAI,EAAE,SAAS,kBAAkB,EAAE,GAClC,OAAO,CAKT;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAGzF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** True only when the ordered attachment identities are unchanged. */
|
|
2
|
+
export function attachmentIdsEqual(current, next) {
|
|
3
|
+
return (current.length === next.length &&
|
|
4
|
+
current.every((attachment, index) => attachment.attachmentId === next[index]?.attachmentId));
|
|
5
|
+
}
|
|
6
|
+
/** Photo annotation intentionally owns exactly one primary photo. */
|
|
7
|
+
export function singlePrimaryPhoto(files) {
|
|
8
|
+
const primary = files.at(-1);
|
|
9
|
+
return primary ? [primary] : [];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=photo-field-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo-field-state.js","sourceRoot":"","sources":["../src/photo-field-state.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,MAAM,UAAU,kBAAkB,CAChC,OAAsC,EACtC,IAAmC;IAEnC,OAAO,CACL,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;QAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAC5F,CAAA;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAA+B,KAAmB;IAClF,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACjC,CAAC","sourcesContent":["type AttachmentIdentity = { attachmentId: string }\n\n/** True only when the ordered attachment identities are unchanged. */\nexport function attachmentIdsEqual(\n current: readonly AttachmentIdentity[],\n next: readonly AttachmentIdentity[],\n): boolean {\n return (\n current.length === next.length &&\n current.every((attachment, index) => attachment.attachmentId === next[index]?.attachmentId)\n )\n}\n\n/** Photo annotation intentionally owns exactly one primary photo. */\nexport function singlePrimaryPhoto<T extends AttachmentIdentity>(files: readonly T[]): T[] {\n const primary = files.at(-1)\n return primary ? [primary] : []\n}\n"]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AppLocale } from '@braedonsaunders/appkit-i18n';
|
|
3
|
+
import type { FormSchemaV1 } from '@braedonsaunders/appkit-forms-core';
|
|
4
|
+
import type { FormDataSource } from './properties.js';
|
|
5
|
+
import type { ListConfig, RecordActionFlow, RecordActionFlowAdapter, RecordConfig } from './record-config.js';
|
|
6
|
+
export type ProductionFormKind = 'form' | 'wizard' | 'checklist' | 'register' | 'mini_app';
|
|
7
|
+
export type ProductionDesignerOverview = {
|
|
8
|
+
description: string | null;
|
|
9
|
+
category: string | null;
|
|
10
|
+
iconKey: string | null;
|
|
11
|
+
emailOnSubmit: boolean;
|
|
12
|
+
surfaceAsTool: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type ProductionDesignerResult = {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
export type ProductionFormDesignerAdapter = {
|
|
19
|
+
publish(input: {
|
|
20
|
+
templateId: string;
|
|
21
|
+
schema: FormSchemaV1;
|
|
22
|
+
changelog: string;
|
|
23
|
+
}): Promise<ProductionDesignerResult & {
|
|
24
|
+
version?: number;
|
|
25
|
+
}>;
|
|
26
|
+
saveOverview(input: {
|
|
27
|
+
templateId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
surfaceAsTool: boolean;
|
|
31
|
+
}): Promise<ProductionDesignerResult>;
|
|
32
|
+
saveRecordConfig(input: {
|
|
33
|
+
templateId: string;
|
|
34
|
+
recordConfig: RecordConfig;
|
|
35
|
+
}): Promise<ProductionDesignerResult>;
|
|
36
|
+
saveListConfig(input: {
|
|
37
|
+
templateId: string;
|
|
38
|
+
listConfig: ListConfig;
|
|
39
|
+
}): Promise<ProductionDesignerResult>;
|
|
40
|
+
savePermissions(input: {
|
|
41
|
+
templateId: string;
|
|
42
|
+
allowedRoles: string[];
|
|
43
|
+
}): Promise<ProductionDesignerResult>;
|
|
44
|
+
setPinned?(input: {
|
|
45
|
+
templateId: string;
|
|
46
|
+
pinned: boolean;
|
|
47
|
+
}): Promise<ProductionDesignerResult>;
|
|
48
|
+
navigate?(href: string): void;
|
|
49
|
+
};
|
|
50
|
+
export type ProductionDesignerFlowsInput = {
|
|
51
|
+
templateId: string;
|
|
52
|
+
name: string;
|
|
53
|
+
schema: FormSchemaV1;
|
|
54
|
+
flows: RecordActionFlow[];
|
|
55
|
+
};
|
|
56
|
+
export type ProductionDesignerAssistantInput = {
|
|
57
|
+
open: boolean;
|
|
58
|
+
onClose(): void;
|
|
59
|
+
templateId: string;
|
|
60
|
+
schema: FormSchemaV1;
|
|
61
|
+
apply(schema: FormSchemaV1): void;
|
|
62
|
+
};
|
|
63
|
+
export type ProductionFormDesignerProps = {
|
|
64
|
+
adapter: ProductionFormDesignerAdapter;
|
|
65
|
+
templateId: string;
|
|
66
|
+
templateName: string;
|
|
67
|
+
templateKind?: ProductionFormKind;
|
|
68
|
+
initialSchema: FormSchemaV1;
|
|
69
|
+
currentVersion: number;
|
|
70
|
+
initialSurface?: 'build' | 'flows';
|
|
71
|
+
overview?: ProductionDesignerOverview;
|
|
72
|
+
recordConfig?: RecordConfig;
|
|
73
|
+
allowedRoles?: string[];
|
|
74
|
+
roles?: {
|
|
75
|
+
key: string;
|
|
76
|
+
name: string;
|
|
77
|
+
}[];
|
|
78
|
+
flows?: RecordActionFlow[];
|
|
79
|
+
recordActionAdapter: RecordActionFlowAdapter;
|
|
80
|
+
dataSources?: readonly FormDataSource[];
|
|
81
|
+
dataSourcesLoading?: boolean;
|
|
82
|
+
onRefreshDataSources?: () => void | Promise<void>;
|
|
83
|
+
renderFlows?: (input: ProductionDesignerFlowsInput) => ReactNode;
|
|
84
|
+
renderAssistant?: (input: ProductionDesignerAssistantInput) => ReactNode;
|
|
85
|
+
backHref: string;
|
|
86
|
+
recordsHref: string;
|
|
87
|
+
assignmentCreateHref: string;
|
|
88
|
+
assignmentsHref: string;
|
|
89
|
+
dataSourcesHref?: string;
|
|
90
|
+
publishedHref?: string;
|
|
91
|
+
canPin?: boolean;
|
|
92
|
+
pinned?: boolean;
|
|
93
|
+
onSchemaChange?: (schema: FormSchemaV1) => void;
|
|
94
|
+
locale: AppLocale;
|
|
95
|
+
defaultLocale: AppLocale;
|
|
96
|
+
enabledLocales: readonly AppLocale[];
|
|
97
|
+
localeLabels?: Partial<Record<AppLocale, string>>;
|
|
98
|
+
className?: string;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=production-designer-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-designer-adapter.d.ts","sourceRoot":"","sources":["../src/production-designer-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,KAAK,EAAE,c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AAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACvC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC1B,mBAAmB,EAAE,uBAAuB,CAAA;IAC5C,WAAW,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IACvC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAA;IAChE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,SAAS,CAAA;IACxE,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IAC/C,MAAM,EAAE,SAAS,CAAA;IACjB,aAAa,EAAE,SAAS,CAAA;IACxB,cAAc,EAAE,SAAS,SAAS,EAAE,CAAA;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-designer-adapter.js","sourceRoot":"","sources":["../src/production-designer-adapter.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react'\nimport type { AppLocale } from '@braedonsaunders/appkit-i18n'\nimport type { FormSchemaV1 } from '@braedonsaunders/appkit-forms-core'\nimport type { FormDataSource } from './properties'\nimport type {\n ListConfig,\n RecordActionFlow,\n RecordActionFlowAdapter,\n RecordConfig,\n} from './record-config'\n\nexport type ProductionFormKind = 'form' | 'wizard' | 'checklist' | 'register' | 'mini_app'\n\nexport type ProductionDesignerOverview = {\n description: string | null\n category: string | null\n iconKey: string | null\n emailOnSubmit: boolean\n surfaceAsTool: boolean\n}\n\nexport type ProductionDesignerResult = {\n ok: boolean\n error?: string\n}\n\nexport type ProductionFormDesignerAdapter = {\n publish(input: {\n templateId: string\n schema: FormSchemaV1\n changelog: string\n }): Promise<ProductionDesignerResult & { version?: number }>\n saveOverview(input: {\n templateId: string\n name: string\n description: string\n surfaceAsTool: boolean\n }): Promise<ProductionDesignerResult>\n saveRecordConfig(input: {\n templateId: string\n recordConfig: RecordConfig\n }): Promise<ProductionDesignerResult>\n saveListConfig(input: {\n templateId: string\n listConfig: ListConfig\n }): Promise<ProductionDesignerResult>\n savePermissions(input: {\n templateId: string\n allowedRoles: string[]\n }): Promise<ProductionDesignerResult>\n setPinned?(input: {\n templateId: string\n pinned: boolean\n }): Promise<ProductionDesignerResult>\n navigate?(href: string): void\n}\n\nexport type ProductionDesignerFlowsInput = {\n templateId: string\n name: string\n schema: FormSchemaV1\n flows: RecordActionFlow[]\n}\n\nexport type ProductionDesignerAssistantInput = {\n open: boolean\n onClose(): void\n templateId: string\n schema: FormSchemaV1\n apply(schema: FormSchemaV1): void\n}\n\nexport type ProductionFormDesignerProps = {\n adapter: ProductionFormDesignerAdapter\n templateId: string\n templateName: string\n templateKind?: ProductionFormKind\n initialSchema: FormSchemaV1\n currentVersion: number\n initialSurface?: 'build' | 'flows'\n overview?: ProductionDesignerOverview\n recordConfig?: RecordConfig\n allowedRoles?: string[]\n roles?: { key: string; name: string }[]\n flows?: RecordActionFlow[]\n recordActionAdapter: RecordActionFlowAdapter\n dataSources?: readonly FormDataSource[]\n dataSourcesLoading?: boolean\n onRefreshDataSources?: () => void | Promise<void>\n renderFlows?: (input: ProductionDesignerFlowsInput) => ReactNode\n renderAssistant?: (input: ProductionDesignerAssistantInput) => ReactNode\n backHref: string\n recordsHref: string\n assignmentCreateHref: string\n assignmentsHref: string\n dataSourcesHref?: string\n publishedHref?: string\n canPin?: boolean\n pinned?: boolean\n onSchemaChange?: (schema: FormSchemaV1) => void\n locale: AppLocale\n defaultLocale: AppLocale\n enabledLocales: readonly AppLocale[]\n localeLabels?: Partial<Record<AppLocale, string>>\n className?: string\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type FinalizeUploadAction, type RequestUploadAction } from '@braedonsaunders/appkit-ui';
|
|
3
|
+
export type ProductionAttachedFile = {
|
|
4
|
+
attachmentId: string;
|
|
5
|
+
filename: string;
|
|
6
|
+
contentType: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
9
|
+
export type ProductionFileUploadProps = {
|
|
10
|
+
value: ProductionAttachedFile[];
|
|
11
|
+
onChange: (files: ProductionAttachedFile[]) => void;
|
|
12
|
+
requestUpload: RequestUploadAction;
|
|
13
|
+
finalizeUpload: FinalizeUploadAction;
|
|
14
|
+
accept?: string;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
maxFiles?: number;
|
|
17
|
+
onUploadingChange?: (uploading: boolean) => void;
|
|
18
|
+
variant?: 'photo' | 'file' | 'video' | 'audio';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Production form-field uploader: controlled attachments, environment camera
|
|
22
|
+
* capture, bounded counts, reserved upload/finalize protocol, previews, and
|
|
23
|
+
* removal. Storage policy remains an injected application boundary.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ProductionFileUpload({ value, onChange, requestUpload, finalizeUpload, accept, multiple, maxFiles, onUploadingChange, variant, }: ProductionFileUploadProps): React.JSX.Element;
|
|
26
|
+
export declare function dataUrlToFile(dataUrl: string, filename: string): File;
|
|
27
|
+
//# sourceMappingURL=production-file-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-file-upload.d.ts","sourceRoot":"","sources":["../src/production-file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAYD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,sBAAsB,EAAE,CAAA;IAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,IAAI,CAAA;IACnD,aAAa,EAAE,mBAAmB,CAAA;IAClC,cAAc,EAAE,oBAAoB,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;CAC/C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EACd,MAAM,EACN,QAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,OAAgB,GACjB,EAAE,yBAAyB,qBAqH3B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOrE"}
|