@svgrid/enterprise 3.0.0 → 3.0.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.
Files changed (390) hide show
  1. package/README.md +95 -95
  2. package/dist/ExpressionEditorHarness.svelte.d.ts +2 -2
  3. package/dist/SvAdvancedFilter.svelte.d.ts +2 -2
  4. package/dist/SvAlertRuleEditor.svelte.d.ts +2 -2
  5. package/dist/SvAlertsManager.svelte.d.ts +3 -3
  6. package/dist/SvAlertsPanel.svelte.d.ts +1 -1
  7. package/dist/SvAuthGate.svelte +115 -115
  8. package/dist/SvAuthGate.svelte.d.ts +1 -1
  9. package/dist/SvBoard.svelte.d.ts +1 -1
  10. package/dist/SvExportMenu.svelte +553 -553
  11. package/dist/SvExportMenu.svelte.d.ts +2 -2
  12. package/dist/SvExpressionEditor.svelte.d.ts +2 -2
  13. package/dist/SvFileInput.svelte +113 -113
  14. package/dist/SvFormulaBar.svelte +606 -0
  15. package/dist/SvFormulaBar.svelte.d.ts +62 -0
  16. package/dist/SvGridAlerts.svelte.d.ts +2 -2
  17. package/dist/SvGridBoard.svelte +2358 -2358
  18. package/dist/SvGridBulkEditDrawer.svelte.d.ts +1 -1
  19. package/dist/SvGridEditPanel.svelte +1157 -1157
  20. package/dist/SvGridEditPanel.svelte.d.ts +3 -3
  21. package/dist/SvGridMasterDetail.svelte +116 -116
  22. package/dist/SvGridMasterDetail.svelte.d.ts +1 -1
  23. package/dist/SvGridScheduler.svelte +5358 -5358
  24. package/dist/SvImportDialog.svelte +1020 -1020
  25. package/dist/SvImportDialog.svelte.d.ts +2 -2
  26. package/dist/SvLookupInput.svelte +180 -180
  27. package/dist/SvLookupInput.svelte.d.ts +1 -1
  28. package/dist/SvPivotDesigner.svelte +2041 -1990
  29. package/dist/SvPivotDesigner.svelte.d.ts +2 -2
  30. package/dist/SvRecordDetail.svelte.d.ts +1 -1
  31. package/dist/SvRibbonIcon.svelte +46 -0
  32. package/dist/SvRibbonIcon.svelte.d.ts +17 -0
  33. package/dist/SvSchedule.svelte.d.ts +1 -1
  34. package/dist/SvSchemaChart.svelte +236 -234
  35. package/dist/SvSchemaChart.svelte.d.ts +2 -2
  36. package/dist/SvSchemaDashboard.svelte +130 -130
  37. package/dist/SvSchemaDashboard.svelte.d.ts +3 -3
  38. package/dist/SvSheet.svelte +4114 -0
  39. package/dist/SvSheet.svelte.d.ts +142 -0
  40. package/dist/SvSheetComment.svelte +98 -0
  41. package/dist/SvSheetComment.svelte.d.ts +22 -0
  42. package/dist/SvSheetConditionalFormat.svelte +162 -0
  43. package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
  44. package/dist/SvSheetDataValidation.svelte +249 -0
  45. package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
  46. package/dist/SvSheetFilterMenu.svelte +217 -0
  47. package/dist/SvSheetFilterMenu.svelte.d.ts +17 -0
  48. package/dist/SvSheetFindReplace.svelte +132 -0
  49. package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
  50. package/dist/SvSheetFormatCells.svelte +421 -0
  51. package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
  52. package/dist/SvSheetGoalSeek.svelte +144 -0
  53. package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
  54. package/dist/SvSheetInsertFunction.svelte +147 -0
  55. package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
  56. package/dist/SvSheetListPicker.svelte +89 -0
  57. package/dist/SvSheetListPicker.svelte.d.ts +16 -0
  58. package/dist/SvSheetManageRules.svelte +185 -0
  59. package/dist/SvSheetManageRules.svelte.d.ts +16 -0
  60. package/dist/SvSheetNameManager.svelte +225 -0
  61. package/dist/SvSheetNameManager.svelte.d.ts +11 -0
  62. package/dist/SvSheetPasteSpecial.svelte +105 -0
  63. package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
  64. package/dist/SvSheetRemoveDuplicates.svelte +149 -0
  65. package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
  66. package/dist/SvSheetRibbon.svelte +1201 -0
  67. package/dist/SvSheetRibbon.svelte.d.ts +34 -0
  68. package/dist/SvSheetSizeDialog.svelte +58 -0
  69. package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
  70. package/dist/SvSheetTabs.svelte +441 -0
  71. package/dist/SvSheetTabs.svelte.d.ts +36 -0
  72. package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
  73. package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
  74. package/dist/SvSheetTextToColumns.svelte +172 -0
  75. package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
  76. package/dist/SvSheetValidationAlert.svelte +83 -0
  77. package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
  78. package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -1
  79. package/dist/advanced-filter-enable.js +3 -3
  80. package/dist/alerts/alert-engine-attach.d.ts +2 -2
  81. package/dist/alerts/alert-engine-attach.js +3 -3
  82. package/dist/alerts/alert-engine.d.ts +1 -1
  83. package/dist/alerts/alert-engine.js +2 -2
  84. package/dist/alerts/alert-formats.d.ts +1 -1
  85. package/dist/alerts/alert-formats.js +1 -1
  86. package/dist/alerts/alert-observer.d.ts +3 -3
  87. package/dist/alerts/alert-observer.js +1 -1
  88. package/dist/alerts/alert-storage.d.ts +1 -1
  89. package/dist/alerts/alert-store.svelte.d.ts +1 -1
  90. package/dist/alerts/alert-types.d.ts +2 -2
  91. package/dist/alerts.js +2 -2
  92. package/dist/board.js +2 -2
  93. package/dist/cdn/svgrid-enterprise.svelte-external.js +19046 -5428
  94. package/dist/designer/assets/GridMenus-BlsvL_aU.js +8 -0
  95. package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
  96. package/dist/designer/assets/SvChartMenu-D9hEeHar.js +1 -0
  97. package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
  98. package/dist/designer/assets/SvDateRangeInput-C0iCCZ8o.css +1 -0
  99. package/dist/designer/assets/SvDateTimePicker-DARvKUL2.js +1 -0
  100. package/dist/designer/assets/SvDateTimePicker-DPv09DIT.css +1 -0
  101. package/dist/designer/assets/{preload-helper-CG0n22O7.js → SvGrid.helpers-BgT-gnCo.js} +1 -1
  102. package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +4 -0
  103. package/dist/designer/assets/SvGridChart-B8j1SSy3.js +3 -0
  104. package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
  105. package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
  106. package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +1 -0
  107. package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
  108. package/dist/designer/assets/SvGridChartPanel-pT6ITc2P.js +4 -0
  109. package/dist/designer/assets/SvGridChartView-7msfnWZT.css +1 -0
  110. package/dist/designer/assets/SvGridChartView-bg281UA1.js +1 -0
  111. package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +1 -0
  112. package/dist/designer/assets/SvGridDropdown-CcidB3rm.css +1 -0
  113. package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
  114. package/dist/designer/assets/SvListBox-BXfyqy4a.css +1 -0
  115. package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
  116. package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
  117. package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
  118. package/dist/designer/assets/SvTabs-UFCMTHXS.js +1 -0
  119. package/dist/designer/assets/cell-formatting-wr5wm7US.js +1 -0
  120. package/dist/designer/assets/chart-cIPUsbM5.js +1 -0
  121. package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
  122. package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
  123. package/dist/designer/assets/chart-panel-messages-DtTxpBUU.js +1 -0
  124. package/dist/designer/assets/chart-summary-Czu_5epb.js +1 -0
  125. package/dist/designer/assets/chart-trend-D5I5VEe8.js +1 -0
  126. package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
  127. package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
  128. package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
  129. package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
  130. package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
  131. package/dist/designer/assets/export-format-D-eP4b2l.js +6 -0
  132. package/dist/designer/assets/focus-trap-CAreAhlU.js +1 -0
  133. package/dist/designer/assets/index-CMFgAoVV.css +1 -0
  134. package/dist/designer/assets/{index-zUBix-JQ.js → index-DwU7CAMm.js} +2985 -141
  135. package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
  136. package/dist/designer/assets/preload-helper-HclGiUj8.js +1 -0
  137. package/dist/designer/assets/row-resize-DLktcqUK.js +1 -0
  138. package/dist/designer/assets/src-CITpcm6b.js +1 -0
  139. package/dist/designer/assets/src-EdI3Xqds.js +58 -0
  140. package/dist/designer/index.html +32 -23
  141. package/dist/export-conditional.d.ts +1 -1
  142. package/dist/export-pdf.d.ts +89 -0
  143. package/dist/export-pdf.js +130 -0
  144. package/dist/export-print.js +19 -19
  145. package/dist/export-xls.d.ts +2 -2
  146. package/dist/export.d.ts +2 -2
  147. package/dist/export.js +23 -16
  148. package/dist/expressions/builder-tree.d.ts +2 -2
  149. package/dist/expressions/builder-tree.js +1 -1
  150. package/dist/expressions/compile.d.ts +1 -1
  151. package/dist/import.js +1 -1
  152. package/dist/index.d.ts +116 -53
  153. package/dist/index.js +117 -50
  154. package/dist/install.d.ts +4 -4
  155. package/dist/install.js +16 -11
  156. package/dist/license.d.ts +3 -2
  157. package/dist/license.js +9 -4
  158. package/dist/node/studio.js +187 -116
  159. package/dist/pivot-chart.d.ts +26 -2
  160. package/dist/pivot-chart.js +25 -69
  161. package/dist/pivot-designer.d.ts +1 -1
  162. package/dist/pivot-enable.js +3 -3
  163. package/dist/print.d.ts +1 -1
  164. package/dist/print.js +4 -4
  165. package/dist/scheduler-config.d.ts +5 -5
  166. package/dist/scheduler-freebusy.d.ts +1 -1
  167. package/dist/scheduler-freebusy.js +1 -1
  168. package/dist/scheduler.js +2 -2
  169. package/dist/schema-designer.d.ts +1 -1
  170. package/dist/schema-designer.js +2 -2
  171. package/dist/selection-bar.js +2 -2
  172. package/dist/sheet/address.d.ts +43 -0
  173. package/dist/sheet/address.js +81 -0
  174. package/dist/sheet/ast.d.ts +94 -0
  175. package/dist/sheet/ast.js +56 -0
  176. package/dist/sheet/auto-filter.d.ts +66 -0
  177. package/dist/sheet/auto-filter.js +147 -0
  178. package/dist/sheet/autocomplete.d.ts +42 -0
  179. package/dist/sheet/autocomplete.js +162 -0
  180. package/dist/sheet/coerce.d.ts +31 -0
  181. package/dist/sheet/coerce.js +122 -0
  182. package/dist/sheet/commands.d.ts +89 -0
  183. package/dist/sheet/commands.js +230 -0
  184. package/dist/sheet/comments.d.ts +29 -0
  185. package/dist/sheet/comments.js +73 -0
  186. package/dist/sheet/conditional-formats.d.ts +144 -0
  187. package/dist/sheet/conditional-formats.js +316 -0
  188. package/dist/sheet/deps.d.ts +60 -0
  189. package/dist/sheet/deps.js +199 -0
  190. package/dist/sheet/document.d.ts +150 -0
  191. package/dist/sheet/document.js +264 -0
  192. package/dist/sheet/edit-keys.d.ts +14 -0
  193. package/dist/sheet/edit-keys.js +40 -0
  194. package/dist/sheet/entry.d.ts +31 -0
  195. package/dist/sheet/entry.js +76 -0
  196. package/dist/sheet/evaluate.d.ts +61 -0
  197. package/dist/sheet/evaluate.js +337 -0
  198. package/dist/sheet/find-replace.d.ts +62 -0
  199. package/dist/sheet/find-replace.js +152 -0
  200. package/dist/sheet/format-store.d.ts +99 -0
  201. package/dist/sheet/format-store.js +233 -0
  202. package/dist/sheet/freeze.d.ts +54 -0
  203. package/dist/sheet/freeze.js +58 -0
  204. package/dist/sheet/function-catalog.d.ts +10 -0
  205. package/dist/sheet/function-catalog.js +94 -0
  206. package/dist/sheet/functions.d.ts +28 -0
  207. package/dist/sheet/functions.js +362 -0
  208. package/dist/sheet/goal-seek.d.ts +73 -0
  209. package/dist/sheet/goal-seek.js +153 -0
  210. package/dist/sheet/index.d.ts +53 -0
  211. package/dist/sheet/index.js +53 -0
  212. package/dist/sheet/merges.d.ts +71 -0
  213. package/dist/sheet/merges.js +137 -0
  214. package/dist/sheet/names.d.ts +31 -0
  215. package/dist/sheet/names.js +87 -0
  216. package/dist/sheet/navigate.d.ts +52 -0
  217. package/dist/sheet/navigate.js +135 -0
  218. package/dist/sheet/number-format.d.ts +63 -0
  219. package/dist/sheet/number-format.js +508 -0
  220. package/dist/sheet/palette.d.ts +19 -0
  221. package/dist/sheet/palette.js +84 -0
  222. package/dist/sheet/parse.d.ts +13 -0
  223. package/dist/sheet/parse.js +108 -0
  224. package/dist/sheet/paste-special.d.ts +164 -0
  225. package/dist/sheet/paste-special.js +592 -0
  226. package/dist/sheet/protection.d.ts +21 -0
  227. package/dist/sheet/protection.js +48 -0
  228. package/dist/sheet/rects.d.ts +45 -0
  229. package/dist/sheet/rects.js +112 -0
  230. package/dist/sheet/refs.d.ts +82 -0
  231. package/dist/sheet/refs.js +266 -0
  232. package/dist/sheet/ribbon-icons.d.ts +31 -0
  233. package/dist/sheet/ribbon-icons.js +350 -0
  234. package/dist/sheet/ribbon.d.ts +173 -0
  235. package/dist/sheet/ribbon.js +753 -0
  236. package/dist/sheet/shortcuts.d.ts +164 -0
  237. package/dist/sheet/shortcuts.js +623 -0
  238. package/dist/sheet/structure.d.ts +87 -0
  239. package/dist/sheet/structure.js +166 -0
  240. package/dist/sheet/tables.d.ts +70 -0
  241. package/dist/sheet/tables.js +147 -0
  242. package/dist/sheet/tokenize.d.ts +54 -0
  243. package/dist/sheet/tokenize.js +304 -0
  244. package/dist/sheet/transforms.d.ts +76 -0
  245. package/dist/sheet/transforms.js +154 -0
  246. package/dist/sheet/validation.d.ts +92 -0
  247. package/dist/sheet/validation.js +241 -0
  248. package/dist/sheet/workbook.d.ts +72 -0
  249. package/dist/sheet/workbook.js +409 -0
  250. package/dist/sheet-enable.d.ts +6 -0
  251. package/dist/sheet-enable.js +46 -0
  252. package/dist/sources/aggregate.d.ts +1 -1
  253. package/dist/sources/auth-supabase.js +1 -1
  254. package/dist/sources/dashboard.d.ts +2 -2
  255. package/dist/sources/dashboard.js +1 -1
  256. package/dist/sources/index.d.ts +13 -13
  257. package/dist/sources/index.js +13 -13
  258. package/dist/sources/realtime-supabase.js +1 -1
  259. package/dist/sources/relation-lookup.d.ts +1 -1
  260. package/dist/sources/relation-lookup.js +1 -1
  261. package/dist/sources/rest-adapters.d.ts +1 -1
  262. package/dist/sources/rest-adapters.js +1 -1
  263. package/dist/sources/rest.d.ts +2 -2
  264. package/dist/sources/rest.js +3 -3
  265. package/dist/sources/supabase.d.ts +2 -2
  266. package/dist/sources/supabase.js +3 -3
  267. package/dist/sources/with-entity-rules.d.ts +1 -1
  268. package/dist/sources/with-entity-rules.js +1 -1
  269. package/dist/sources/with-relation-labels.d.ts +1 -1
  270. package/dist/studio/emit-project.js +2161 -2127
  271. package/dist/studio/emit-schema.js +369 -369
  272. package/dist/studio/index.d.ts +1 -1
  273. package/dist/studio/index.js +1 -1
  274. package/dist/studio/introspect-db.js +45 -45
  275. package/dist/studio/project.d.ts +10 -0
  276. package/dist/studio/samples/crm.js +6 -6
  277. package/dist/studio/samples/fleet.js +7 -7
  278. package/dist/studio/samples/insurance.js +9 -9
  279. package/dist/studio/samples/inventory.js +12 -12
  280. package/dist/studio/samples/projects.js +5 -5
  281. package/dist/studio/samples/support.js +8 -8
  282. package/dist/studio/scaffold-app.js +104 -104
  283. package/dist/studio/scaffold.js +151 -151
  284. package/dist/studio/ui-components.d.ts +7 -0
  285. package/dist/studio/ui-components.generated.js +63 -1
  286. package/dist/studio/ui-components.js +35 -0
  287. package/dist/sveltekit/in-memory.d.ts +3 -3
  288. package/dist/sveltekit/in-memory.js +4 -4
  289. package/dist/sveltekit/index.d.ts +6 -6
  290. package/dist/sveltekit/index.js +5 -5
  291. package/dist/sveltekit/query-plan.d.ts +1 -1
  292. package/dist/sveltekit/sql-source.d.ts +4 -4
  293. package/dist/sveltekit/sql-source.js +4 -4
  294. package/dist/sveltekit/sql.d.ts +1 -1
  295. package/dist/sveltekit/transport.d.ts +2 -2
  296. package/dist/sveltekit/transport.js +1 -1
  297. package/dist/upgrade-prompt.js +25 -25
  298. package/dist/version.d.ts +1 -1
  299. package/dist/version.js +1 -1
  300. package/package.json +12 -4
  301. package/dist/designer/assets/GridMenus-Cgilexpk.js +0 -8
  302. package/dist/designer/assets/SvDateRangeInput-BV5OXYQ2.css +0 -1
  303. package/dist/designer/assets/SvDateRangeInput-CVn-yqrQ.js +0 -1
  304. package/dist/designer/assets/SvDateTimePicker-BdioTrJQ.js +0 -1
  305. package/dist/designer/assets/SvDateTimePicker-CY8TK4BT.css +0 -1
  306. package/dist/designer/assets/SvField-BF-9TJSd.css +0 -1
  307. package/dist/designer/assets/SvField-BsqiA5me.js +0 -1
  308. package/dist/designer/assets/SvGridCellEditor-dLY7_kk9.js +0 -2
  309. package/dist/designer/assets/SvGridChart-BEDNTdc5.js +0 -2
  310. package/dist/designer/assets/SvGridChart-Vu4Nvjiv.css +0 -1
  311. package/dist/designer/assets/SvGridChartPanel-x3lzSxuf.js +0 -10
  312. package/dist/designer/assets/SvGridChartView-CAKhPELi.js +0 -1
  313. package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +0 -1
  314. package/dist/designer/assets/SvGridDropdown-CAYG7Y-O.js +0 -1
  315. package/dist/designer/assets/SvGridDropdown-Crwb2P3Q.css +0 -1
  316. package/dist/designer/assets/SvListBox-CVYQcLX9.js +0 -1
  317. package/dist/designer/assets/SvListBox-DgN8kvjt.css +0 -1
  318. package/dist/designer/assets/chart-DHEgt4lN.js +0 -1
  319. package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
  320. package/dist/designer/assets/date-format-4DJvNtG2.js +0 -1
  321. package/dist/designer/assets/date-format-Dzy4mTGh.css +0 -1
  322. package/dist/designer/assets/easing-zaypKrr0.js +0 -3
  323. package/dist/designer/assets/export-format-DwjuTfrQ.js +0 -6
  324. package/dist/designer/assets/index-Cp7fDJ3b.css +0 -1
  325. package/dist/designer/assets/js-scroller.svelte-Bhxqb3-c.js +0 -110
  326. package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
  327. package/dist/designer/assets/src-B7DNcoQK.css +0 -1
  328. package/dist/designer/assets/src-BoYyigAC.js +0 -2896
  329. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
  330. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
  331. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -3875
  332. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -1
  333. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -21
  334. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -1
  335. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -1938
  336. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -1
  337. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -205
  338. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -1
  339. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -18
  340. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -1
  341. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -264
  342. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -1
  343. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -697
  344. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -1
  345. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
  346. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
  347. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
  348. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
  349. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
  350. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
  351. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
  352. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
  353. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
  354. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
  355. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
  356. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
  357. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
  358. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
  359. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
  360. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
  361. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
  362. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
  363. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
  364. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
  365. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
  366. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
  367. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
  368. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
  369. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
  370. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
  371. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
  372. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
  373. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
  374. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
  375. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
  376. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
  377. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
  378. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
  379. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
  380. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
  381. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -4938
  382. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -1
  383. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -495
  384. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -1
  385. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -190
  386. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -1
  387. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -8
  388. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -1
  389. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -138
  390. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -1
package/README.md CHANGED
@@ -1,95 +1,95 @@
1
- <p align="center">
2
- <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
- </p>
4
-
5
- <h1 align="center">@svgrid/enterprise</h1>
6
-
7
- <p align="center"><strong>Excel export, import, pivot tables, and print for SvGrid.</strong></p>
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/@svgrid/enterprise"><img src="https://img.shields.io/npm/v/%40svgrid%2Fenterprise.svg?label=%40svgrid%2Fenterprise" alt="npm version" /></a>
11
- <a href="https://svgrid.com/pricing/"><img src="https://img.shields.io/badge/license-commercial-blue.svg" alt="Commercial license" /></a>
12
- <a href="https://svelte.dev"><img src="https://img.shields.io/badge/svelte-5-ff3e00.svg" alt="Svelte 5" /></a>
13
- </p>
14
-
15
- <p align="center">
16
- <a href="https://svgrid.com">Website</a> ·
17
- <a href="https://svgrid.com/docs/">Docs</a> ·
18
- <a href="https://svgrid.com/pricing/">Pricing</a>
19
- </p>
20
-
21
- ---
22
-
23
- `@svgrid/enterprise` layers production export, printing, analytics, extra grid views, and a full data-app layer on top of the MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core. It attaches to the grid's public API without changing it - the same `api` object you already hold simply gains new methods.
24
-
25
- ## What it adds
26
-
27
- - **Data export** - Excel (`.xlsx`), PDF, styled HTML and XML, with theme-matched styling, headers/footers, and image support. CSV, TSV and JSON export (and copy-to-clipboard) are free in `@svgrid/grid`; Enterprise adds the paid formats and a single `exportGrid()` entry point over all of them.
28
- - **Data import** - read Excel / CSV / TSV / JSON into typed rows with column auto-mapping, type inference, and per-row validation, plus a ready-made `SvImportDialog`.
29
- - **Paginated print** - opens a clean, paginated, printable view of the grid with title and page breaks.
30
- - **Pivot tables** - drag-and-drop pivot Designer with row/column/value fields, aggregation, drill-through to source rows, and pivot-to-chart.
31
- - **Scheduler / calendar view** - a Month/Week/Day/Agenda calendar rendered as a view of the grid: `enableSchedulerView()` lets `<SvGrid scheduler={...}>` show events with resources, recurrence, and drag/resize.
32
- - **Staged editing** - collect edits into a reviewable change set before committing.
33
- - **Scheduling automation** - a client-side cron / one-off scheduler (`createScheduler`, `parseCron`, `CRON_PRESETS`) to drive recurring exports and alerts with no backend.
34
- - **SvGrid Studio** - a schema-driven data-app layer: `EntitySchema`, memory / SQL / Supabase / REST data sources, a SvelteKit adapter, edit panels, master/detail, schema charts + KPI dashboards, and the project model + codegen behind the visual designer. See [`@svgrid/studio`](https://www.npmjs.com/package/@svgrid/studio).
35
-
36
- ## Install
37
-
38
- ```bash
39
- npm install @svgrid/enterprise
40
- ```
41
-
42
- Format engines are optional peer dependencies - install only the ones you use:
43
-
44
- ```bash
45
- npm install jszip # Excel (.xlsx) export + import
46
- npm install pdfmake # PDF export
47
- ```
48
-
49
- ## Usage
50
-
51
- ```ts
52
- import { setLicenseKey, installEnterprise } from '@svgrid/enterprise'
53
-
54
- setLicenseKey('SVENTERPRISE-XXXX-XXXX-XXXX') // your Enterprise key
55
-
56
- // Inside <SvGrid onApiReady={(api) => { ... }}>:
57
- const pro = installEnterprise(api)
58
-
59
- // Export / print
60
- await pro.exportData({ format: 'xlsx', filename: 'orders' })
61
- pro.print({ title: 'Q2 Orders' })
62
-
63
- // Import
64
- const result = await pro.importData({ file, format: 'xlsx' })
65
-
66
- // Pivot - returns { rows, columns } for a second <SvGrid>
67
- const { rows, columns } = pro.pivot.build({
68
- rows: ['region'],
69
- values: [{ field: 'total', agg: 'sum' }],
70
- })
71
- ```
72
-
73
- The AI helpers are **not** in this package. Natural-language filter,
74
- smart fill, summarize, classify, anomaly detection, and "chart this" are
75
- built in and free in [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid).
76
- Installing Enterprise only adds the Excel/PDF export engine that
77
- AI-planned exports write through.
78
-
79
- `installEnterprise` returns the same grid API with the enterprise methods (`exportData`, `copyExport`, `print`, `importData`, `pivot.*`) added on top, so the rest of your integration is unchanged. It also registers the Kanban board and scheduler / calendar views, so `<SvGrid board={...}>` and `<SvGrid scheduler={...}>` render.
80
-
81
- ## Licensing
82
-
83
- Commercial. A valid Enterprise key is required at runtime; calls throw without one. Purchase a key at [svgrid.com/pricing](https://svgrid.com/pricing/).
84
-
85
- OSS projects under an [OSI-approved license](https://opensource.org/licenses) qualify for a **free Enterprise key**.
86
-
87
- The source in this package is published for evaluation and for paying customers; visibility does not grant a license. See [LICENSE](./LICENSE).
88
-
89
- ## Support
90
-
91
- Enterprise licenses include commercial and priority support. Open an issue at [github.com/sv-grid/sv-grid](https://github.com/sv-grid/sv-grid/issues) or reach the team via [svgrid.com](https://svgrid.com).
92
-
93
- ## Trademark
94
-
95
- SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.
1
+ <p align="center">
2
+ <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
+ </p>
4
+
5
+ <h1 align="center">@svgrid/enterprise</h1>
6
+
7
+ <p align="center"><strong>Excel export, import, pivot tables, and print for SvGrid.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@svgrid/enterprise"><img src="https://img.shields.io/npm/v/%40svgrid%2Fenterprise.svg?label=%40svgrid%2Fenterprise" alt="npm version" /></a>
11
+ <a href="https://svgrid.com/pricing/"><img src="https://img.shields.io/badge/license-commercial-blue.svg" alt="Commercial license" /></a>
12
+ <a href="https://svelte.dev"><img src="https://img.shields.io/badge/svelte-5-ff3e00.svg" alt="Svelte 5" /></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://svgrid.com">Website</a> ·
17
+ <a href="https://svgrid.com/docs/">Docs</a> ·
18
+ <a href="https://svgrid.com/pricing/">Pricing</a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ `@svgrid/enterprise` layers production export, printing, analytics, extra grid views, and a full data-app layer on top of the MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core. It attaches to the grid's public API without changing it - the same `api` object you already hold simply gains new methods.
24
+
25
+ ## What it adds
26
+
27
+ - **Data export** - Excel (`.xlsx`), PDF, styled HTML and XML, with theme-matched styling, headers/footers, and image support. CSV, TSV and JSON export (and copy-to-clipboard) are free in `@svgrid/grid`; Enterprise adds the paid formats and a single `exportGrid()` entry point over all of them.
28
+ - **Data import** - read Excel / CSV / TSV / JSON into typed rows with column auto-mapping, type inference, and per-row validation, plus a ready-made `SvImportDialog`.
29
+ - **Paginated print** - opens a clean, paginated, printable view of the grid with title and page breaks.
30
+ - **Pivot tables** - drag-and-drop pivot Designer with row/column/value fields, aggregation, drill-through to source rows, and pivot-to-chart.
31
+ - **Scheduler / calendar view** - a Month/Week/Day/Agenda calendar rendered as a view of the grid: `enableSchedulerView()` lets `<SvGrid scheduler={...}>` show events with resources, recurrence, and drag/resize.
32
+ - **Staged editing** - collect edits into a reviewable change set before committing.
33
+ - **Scheduling automation** - a client-side cron / one-off scheduler (`createScheduler`, `parseCron`, `CRON_PRESETS`) to drive recurring exports and alerts with no backend.
34
+ - **SvGrid Studio** - a schema-driven data-app layer: `EntitySchema`, memory / SQL / Supabase / REST data sources, a SvelteKit adapter, edit panels, master/detail, schema charts + KPI dashboards, and the project model + codegen behind the visual designer. See [`@svgrid/studio`](https://www.npmjs.com/package/@svgrid/studio).
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ npm install @svgrid/enterprise
40
+ ```
41
+
42
+ Format engines are optional peer dependencies - install only the ones you use:
43
+
44
+ ```bash
45
+ npm install jszip # Excel (.xlsx) export + import
46
+ npm install pdfmake # PDF export
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ ```ts
52
+ import { setLicenseKey, installEnterprise } from '@svgrid/enterprise'
53
+
54
+ setLicenseKey('SVENTERPRISE-XXXX-XXXX-XXXX') // your Enterprise key
55
+
56
+ // Inside <SvGrid onApiReady={(api) => { ... }}>:
57
+ const pro = installEnterprise(api)
58
+
59
+ // Export / print
60
+ await pro.exportData({ format: 'xlsx', filename: 'orders' })
61
+ pro.print({ title: 'Q2 Orders' })
62
+
63
+ // Import
64
+ const result = await pro.importData({ file, format: 'xlsx' })
65
+
66
+ // Pivot - returns { rows, columns } for a second <SvGrid>
67
+ const { rows, columns } = pro.pivot.build({
68
+ rows: ['region'],
69
+ values: [{ field: 'total', agg: 'sum' }],
70
+ })
71
+ ```
72
+
73
+ The AI helpers are **not** in this package. Natural-language filter,
74
+ smart fill, summarize, classify, anomaly detection, and "chart this" are
75
+ built in and free in [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid).
76
+ Installing Enterprise only adds the Excel/PDF export engine that
77
+ AI-planned exports write through.
78
+
79
+ `installEnterprise` returns the same grid API with the enterprise methods (`exportData`, `copyExport`, `print`, `importData`, `pivot.*`) added on top, so the rest of your integration is unchanged. It also registers the Kanban board and scheduler / calendar views, so `<SvGrid board={...}>` and `<SvGrid scheduler={...}>` render.
80
+
81
+ ## Licensing
82
+
83
+ Commercial. A valid Enterprise key is required at runtime; calls throw without one. Purchase a key at [svgrid.com/pricing](https://svgrid.com/pricing/).
84
+
85
+ OSS projects under an [OSI-approved license](https://opensource.org/licenses) qualify for a **free Enterprise key**.
86
+
87
+ The source in this package is published for evaluation and for paying customers; visibility does not grant a license. See [LICENSE](./LICENSE).
88
+
89
+ ## Support
90
+
91
+ Enterprise licenses include commercial and priority support. Open an issue at [github.com/sv-grid/sv-grid](https://github.com/sv-grid/sv-grid/issues) or reach the team via [svgrid.com](https://svgrid.com).
92
+
93
+ ## Trademark
94
+
95
+ SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.
@@ -1,5 +1,5 @@
1
- import type { ExprColumn } from './expressions/expression-columns';
2
- import type { PredicateExpr } from './expressions/expression-types';
1
+ import type { ExprColumn } from './expressions/expression-columns.js';
2
+ import type { PredicateExpr } from './expressions/expression-types.js';
3
3
  type Props = {
4
4
  columns: ReadonlyArray<ExprColumn>;
5
5
  initial: PredicateExpr;
@@ -1,5 +1,5 @@
1
- import type { ExprColumn } from './expressions/expression-columns';
2
- import type { PredicateExpr } from './expressions/expression-types';
1
+ import type { ExprColumn } from './expressions/expression-columns.js';
2
+ import type { PredicateExpr } from './expressions/expression-types.js';
3
3
  type MinimalApi = {
4
4
  getColumns(): ReadonlyArray<{
5
5
  id: string;
@@ -1,5 +1,5 @@
1
- import type { ExprColumn } from './expressions/expression-columns';
2
- import type { AlertRule } from './alerts/alert-types';
1
+ import type { ExprColumn } from './expressions/expression-columns.js';
2
+ import type { AlertRule } from './alerts/alert-types.js';
3
3
  type Props = {
4
4
  open?: boolean;
5
5
  columns: ReadonlyArray<ExprColumn>;
@@ -1,6 +1,6 @@
1
- import type { ExprColumn } from './expressions/expression-columns';
2
- import type { AlertRulesManager } from './alerts/alert-storage';
3
- import type { AlertRule } from './alerts/alert-types';
1
+ import type { ExprColumn } from './expressions/expression-columns.js';
2
+ import type { AlertRulesManager } from './alerts/alert-storage.js';
3
+ import type { AlertRule } from './alerts/alert-types.js';
4
4
  type Props = {
5
5
  open?: boolean;
6
6
  manager: AlertRulesManager;
@@ -1,4 +1,4 @@
1
- import type { AlertEvent } from './alerts/alert-types';
1
+ import type { AlertEvent } from './alerts/alert-types.js';
2
2
  type Props = {
3
3
  open?: boolean;
4
4
  onJump?: (event: AlertEvent) => void;
@@ -1,115 +1,115 @@
1
- <script lang="ts">
2
- /**
3
- * SvAuthGate - require a signed-in user before showing its content. Renders a
4
- * login / sign-up form when signed out (Supabase Auth via `createSupabaseAuth`)
5
- * and its children when signed in, with a small "signed in as ... / Sign out"
6
- * bar. Pair with Row-Level Security so each user sees only their own rows.
7
- *
8
- * <SvAuthGate {client}>
9
- * <MyStudioScreen />
10
- * </SvAuthGate>
11
- */
12
- import type { Snippet } from 'svelte'
13
- import { createSupabaseAuth, type AuthState, type SupabaseAuthClientLike, type SupabaseAuthController } from './sources/auth-supabase'
14
-
15
- type Props = {
16
- client: SupabaseAuthClientLike
17
- children: Snippet
18
- title?: string
19
- /** Show the "signed in as ... / Sign out" bar. Default true. */
20
- showBar?: boolean
21
- }
22
-
23
- let { client, children, title = 'Sign in', showBar = true }: Props = $props()
24
-
25
- let auth = $state<SupabaseAuthController | undefined>()
26
- let authState = $state<AuthState>({ user: null, loading: true, error: null })
27
- let mode = $state<'signin' | 'signup'>('signin')
28
- let email = $state('')
29
- let password = $state('')
30
-
31
- $effect(() => {
32
- const controller = createSupabaseAuth({ client, onChange: (s) => (authState = s) })
33
- auth = controller
34
- return () => controller.dispose()
35
- })
36
-
37
- function submit(e: SubmitEvent) {
38
- e.preventDefault()
39
- if (mode === 'signin') auth?.signIn(email, password)
40
- else auth?.signUp(email, password)
41
- }
42
- </script>
43
-
44
- {#if authState.user}
45
- {#if showBar}
46
- <div class="sv-auth-bar">
47
- <span>Signed in as <strong>{authState.user.email ?? authState.user.id}</strong></span>
48
- <button type="button" onclick={() => auth?.signOut()} disabled={authState.loading}>Sign out</button>
49
- </div>
50
- {/if}
51
- {@render children()}
52
- {:else}
53
- <div class="sv-auth">
54
- <form class="sv-auth__form" onsubmit={submit}>
55
- <h2 class="sv-auth__title">{mode === 'signin' ? title : 'Create account'}</h2>
56
-
57
- <label class="sv-auth__field">
58
- <span>Email</span>
59
- <input type="email" autocomplete="email" bind:value={email} required />
60
- </label>
61
- <label class="sv-auth__field">
62
- <span>Password</span>
63
- <input type="password" autocomplete="current-password" bind:value={password} required />
64
- </label>
65
-
66
- {#if authState.error}<p class="sv-auth__error">{authState.error}</p>{/if}
67
-
68
- <button class="sv-auth__submit" type="submit" disabled={authState.loading}>
69
- {authState.loading ? 'Please wait…' : mode === 'signin' ? 'Sign in' : 'Create account'}
70
- </button>
71
-
72
- <button
73
- type="button"
74
- class="sv-auth__toggle"
75
- onclick={() => (mode = mode === 'signin' ? 'signup' : 'signin')}
76
- >
77
- {mode === 'signin' ? 'Need an account? Sign up' : 'Have an account? Sign in'}
78
- </button>
79
- </form>
80
- </div>
81
- {/if}
82
-
83
- <style>
84
- .sv-auth { display: flex; justify-content: center; padding: 32px 16px; }
85
- .sv-auth__form {
86
- display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px;
87
- padding: 24px; border: 1px solid var(--sg-border, #e2e2e2); border-radius: 12px;
88
- background: var(--sg-bg, #fff); color: var(--sg-fg, inherit);
89
- }
90
- .sv-auth__title { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
91
- .sv-auth__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--sg-muted, #555); }
92
- .sv-auth__field input {
93
- padding: 8px 10px; border: 1px solid var(--sg-border, #ccc); border-radius: 6px;
94
- background: var(--sg-input-bg, #fff); color: var(--sg-fg, inherit); font: inherit;
95
- }
96
- .sv-auth__error { margin: 0; font-size: 13px; color: #dc2626; }
97
- .sv-auth__submit {
98
- padding: 9px 12px; border: 1px solid var(--sg-accent, #2563eb); border-radius: 6px;
99
- background: var(--sg-accent, #2563eb); color: #fff; cursor: pointer; font: inherit; font-weight: 600;
100
- }
101
- .sv-auth__submit:disabled { opacity: 0.6; cursor: default; }
102
- .sv-auth__toggle { border: none; background: none; color: var(--sg-accent, #2563eb); cursor: pointer; font: inherit; font-size: 13px; }
103
-
104
- .sv-auth-bar {
105
- display: flex; align-items: center; justify-content: space-between; gap: 12px;
106
- padding: 8px 12px; margin-bottom: 12px; font-size: 13px;
107
- border: 1px solid var(--sg-border, #e2e2e2); border-radius: 8px;
108
- background: var(--sg-header-bg, #f8fafc); color: var(--sg-fg, inherit);
109
- }
110
- .sv-auth-bar button {
111
- padding: 5px 10px; border: 1px solid var(--sg-border, #ccc); border-radius: 6px;
112
- background: var(--sg-bg, #fff); color: var(--sg-fg, inherit); cursor: pointer; font: inherit;
113
- }
114
- .sv-auth-bar button:disabled { opacity: 0.5; cursor: default; }
115
- </style>
1
+ <script lang="ts">
2
+ /**
3
+ * SvAuthGate - require a signed-in user before showing its content. Renders a
4
+ * login / sign-up form when signed out (Supabase Auth via `createSupabaseAuth`)
5
+ * and its children when signed in, with a small "signed in as ... / Sign out"
6
+ * bar. Pair with Row-Level Security so each user sees only their own rows.
7
+ *
8
+ * <SvAuthGate {client}>
9
+ * <MyStudioScreen />
10
+ * </SvAuthGate>
11
+ */
12
+ import type { Snippet } from 'svelte'
13
+ import { createSupabaseAuth, type AuthState, type SupabaseAuthClientLike, type SupabaseAuthController } from './sources/auth-supabase'
14
+
15
+ type Props = {
16
+ client: SupabaseAuthClientLike
17
+ children: Snippet
18
+ title?: string
19
+ /** Show the "signed in as ... / Sign out" bar. Default true. */
20
+ showBar?: boolean
21
+ }
22
+
23
+ let { client, children, title = 'Sign in', showBar = true }: Props = $props()
24
+
25
+ let auth = $state<SupabaseAuthController | undefined>()
26
+ let authState = $state<AuthState>({ user: null, loading: true, error: null })
27
+ let mode = $state<'signin' | 'signup'>('signin')
28
+ let email = $state('')
29
+ let password = $state('')
30
+
31
+ $effect(() => {
32
+ const controller = createSupabaseAuth({ client, onChange: (s) => (authState = s) })
33
+ auth = controller
34
+ return () => controller.dispose()
35
+ })
36
+
37
+ function submit(e: SubmitEvent) {
38
+ e.preventDefault()
39
+ if (mode === 'signin') auth?.signIn(email, password)
40
+ else auth?.signUp(email, password)
41
+ }
42
+ </script>
43
+
44
+ {#if authState.user}
45
+ {#if showBar}
46
+ <div class="sv-auth-bar">
47
+ <span>Signed in as <strong>{authState.user.email ?? authState.user.id}</strong></span>
48
+ <button type="button" onclick={() => auth?.signOut()} disabled={authState.loading}>Sign out</button>
49
+ </div>
50
+ {/if}
51
+ {@render children()}
52
+ {:else}
53
+ <div class="sv-auth">
54
+ <form class="sv-auth__form" onsubmit={submit}>
55
+ <h2 class="sv-auth__title">{mode === 'signin' ? title : 'Create account'}</h2>
56
+
57
+ <label class="sv-auth__field">
58
+ <span>Email</span>
59
+ <input type="email" autocomplete="email" bind:value={email} required />
60
+ </label>
61
+ <label class="sv-auth__field">
62
+ <span>Password</span>
63
+ <input type="password" autocomplete="current-password" bind:value={password} required />
64
+ </label>
65
+
66
+ {#if authState.error}<p class="sv-auth__error">{authState.error}</p>{/if}
67
+
68
+ <button class="sv-auth__submit" type="submit" disabled={authState.loading}>
69
+ {authState.loading ? 'Please wait…' : mode === 'signin' ? 'Sign in' : 'Create account'}
70
+ </button>
71
+
72
+ <button
73
+ type="button"
74
+ class="sv-auth__toggle"
75
+ onclick={() => (mode = mode === 'signin' ? 'signup' : 'signin')}
76
+ >
77
+ {mode === 'signin' ? 'Need an account? Sign up' : 'Have an account? Sign in'}
78
+ </button>
79
+ </form>
80
+ </div>
81
+ {/if}
82
+
83
+ <style>
84
+ .sv-auth { display: flex; justify-content: center; padding: 32px 16px; }
85
+ .sv-auth__form {
86
+ display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px;
87
+ padding: 24px; border: 1px solid var(--sg-border, #e2e2e2); border-radius: 12px;
88
+ background: var(--sg-bg, #fff); color: var(--sg-fg, inherit);
89
+ }
90
+ .sv-auth__title { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
91
+ .sv-auth__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--sg-muted, #555); }
92
+ .sv-auth__field input {
93
+ padding: 8px 10px; border: 1px solid var(--sg-border, #ccc); border-radius: 6px;
94
+ background: var(--sg-input-bg, #fff); color: var(--sg-fg, inherit); font: inherit;
95
+ }
96
+ .sv-auth__error { margin: 0; font-size: 13px; color: #dc2626; }
97
+ .sv-auth__submit {
98
+ padding: 9px 12px; border: 1px solid var(--sg-accent, #2563eb); border-radius: 6px;
99
+ background: var(--sg-accent, #2563eb); color: #fff; cursor: pointer; font: inherit; font-weight: 600;
100
+ }
101
+ .sv-auth__submit:disabled { opacity: 0.6; cursor: default; }
102
+ .sv-auth__toggle { border: none; background: none; color: var(--sg-accent, #2563eb); cursor: pointer; font: inherit; font-size: 13px; }
103
+
104
+ .sv-auth-bar {
105
+ display: flex; align-items: center; justify-content: space-between; gap: 12px;
106
+ padding: 8px 12px; margin-bottom: 12px; font-size: 13px;
107
+ border: 1px solid var(--sg-border, #e2e2e2); border-radius: 8px;
108
+ background: var(--sg-header-bg, #f8fafc); color: var(--sg-fg, inherit);
109
+ }
110
+ .sv-auth-bar button {
111
+ padding: 5px 10px; border: 1px solid var(--sg-border, #ccc); border-radius: 6px;
112
+ background: var(--sg-bg, #fff); color: var(--sg-fg, inherit); cursor: pointer; font: inherit;
113
+ }
114
+ .sv-auth-bar button:disabled { opacity: 0.5; cursor: default; }
115
+ </style>
@@ -9,7 +9,7 @@
9
9
  * </SvAuthGate>
10
10
  */
11
11
  import type { Snippet } from 'svelte';
12
- import { type SupabaseAuthClientLike } from './sources/auth-supabase';
12
+ import { type SupabaseAuthClientLike } from './sources/auth-supabase.js';
13
13
  type Props = {
14
14
  client: SupabaseAuthClientLike;
15
15
  children: Snippet;
@@ -9,7 +9,7 @@
9
9
  * SvSchemaChart / SvGridEditPanel), so both the generated app and the designer
10
10
  * preview render it identically.
11
11
  */
12
- import type { EntitySchema } from './schema';
12
+ import type { EntitySchema } from './schema.js';
13
13
  type Row = Record<string, unknown>;
14
14
  type $$ComponentProps = {
15
15
  schema: EntitySchema<any>;