opacacms 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +31 -22
  2. package/dist/admin/auth-client.d.ts +39 -39
  3. package/dist/admin/index.d.ts +2 -2
  4. package/dist/admin/index.js +15 -10520
  5. package/dist/admin/plugin-client.d.ts +65 -0
  6. package/dist/admin/react.d.ts +2 -2
  7. package/dist/admin/react.js +34 -4
  8. package/dist/admin/stores/ui.d.ts +19 -4
  9. package/dist/admin/ui/components/PluginSettingsForm.d.ts +2 -2
  10. package/dist/admin/ui/components/custom-alert.d.ts +7 -0
  11. package/dist/admin/ui/components/{DetailSheet.d.ts → detail-sheet.d.ts} +1 -2
  12. package/dist/admin/ui/components/fields/FieldLabel.d.ts +1 -1
  13. package/dist/admin/ui/components/fields/RelationshipField.d.ts +1 -1
  14. package/dist/admin/ui/components/media/AssetManagerModal.d.ts +2 -2
  15. package/dist/admin/ui/components/plugin-iframe.d.ts +7 -0
  16. package/dist/admin/ui/components/ui/accordion.d.ts +17 -7
  17. package/dist/admin/ui/components/ui/alert-dialog.d.ts +16 -12
  18. package/dist/admin/ui/components/ui/button.d.ts +11 -7
  19. package/dist/admin/ui/components/ui/relationship.d.ts +1 -1
  20. package/dist/admin/ui/components/ui/sheet.d.ts +14 -27
  21. package/dist/admin/ui/components/ui/tooltip.d.ts +7 -0
  22. package/dist/admin/ui/components/versions-sheet.d.ts +4 -5
  23. package/dist/admin/ui/views/collection-list-view.d.ts +1 -1
  24. package/dist/admin/ui/views/dashboard-view.d.ts +1 -1
  25. package/dist/admin/ui/views/media-registry-view.d.ts +3 -3
  26. package/dist/admin/ui/views/settings-view.d.ts +2 -2
  27. package/dist/admin/vue.js +27 -4
  28. package/dist/admin/webcomponent.js +20 -2
  29. package/dist/admin.css +1 -1
  30. package/dist/auth/index.d.ts +43 -43
  31. package/dist/{chunk-7y1nbmw6.js → chunk-1bd7fz7n.js} +32 -2
  32. package/dist/chunk-1qm0m8r8.js +413 -0
  33. package/dist/chunk-2k3ysje3.js +31 -0
  34. package/dist/chunk-3j9zjfmn.js +376 -0
  35. package/dist/{chunk-byq8g0rd.js → chunk-48ywpd0a.js} +16 -22
  36. package/dist/{chunk-esrg9qj0.js → chunk-5422w4eq.js} +70 -54
  37. package/dist/chunk-56n342hs.js +95 -0
  38. package/dist/chunk-5b8r0v8c.js +47 -0
  39. package/dist/chunk-63yg00vx.js +263 -0
  40. package/dist/{chunk-8sqjbsgt.js → chunk-6bywt602.js} +26 -1
  41. package/dist/{chunk-v9z61v3g.js → chunk-6qs0g65f.js} +43 -3
  42. package/dist/chunk-7rr5p01g.js +581 -0
  43. package/dist/{chunk-51z3x7kq.js → chunk-a3qae86h.js} +1 -1
  44. package/dist/{chunk-3rdhbedb.js → chunk-adq2b75c.js} +2 -2
  45. package/dist/chunk-d0tb1xjw.js +93 -0
  46. package/dist/chunk-d7cgd6vn.js +318 -0
  47. package/dist/{chunk-0bq155dy.js → chunk-e0g6gn7n.js} +89 -100
  48. package/dist/chunk-ec4jhybj.js +1137 -0
  49. package/dist/chunk-fatyf6f7.js +221 -0
  50. package/dist/{chunk-526a3gqx.js → chunk-fnsf1dfm.js} +1 -1
  51. package/dist/chunk-g9bxb6h0.js +205 -0
  52. package/dist/chunk-gyaf5kgf.js +10 -0
  53. package/dist/{chunk-9kxpbcb1.js → chunk-h6dhexzr.js} +16 -7
  54. package/dist/{chunk-dykn5hr6.js → chunk-j8js1y0h.js} +31 -74
  55. package/dist/{chunk-t0zg026p.js → chunk-jq1drsen.js} +12 -1
  56. package/dist/{chunk-b3kr8w41.js → chunk-m24yqkeq.js} +38 -26
  57. package/dist/chunk-m5ems3hh.js +410 -0
  58. package/dist/{chunk-8scgdznr.js → chunk-m83ybzf8.js} +15 -18
  59. package/dist/chunk-majsbncm.js +98 -0
  60. package/dist/chunk-mp2gt9yh.js +237 -0
  61. package/dist/chunk-n1twhqmf.js +54 -0
  62. package/dist/{chunk-gmee4mdc.js → chunk-naqcqj8n.js} +92 -106
  63. package/dist/chunk-q5sb5dcr.js +15 -0
  64. package/dist/{chunk-d1asgtke.js → chunk-qhdsjek6.js} +90 -121
  65. package/dist/{chunk-0gtxnxmd.js → chunk-qsh2nqz3.js} +85 -105
  66. package/dist/chunk-r0ms5tk1.js +76 -0
  67. package/dist/chunk-rwqwsanx.js +75 -0
  68. package/dist/chunk-sqsfk9p4.js +700 -0
  69. package/dist/{chunk-5gvbp2qa.js → chunk-x7bnzswh.js} +25 -18
  70. package/dist/{chunk-kc4jfnv7.js → chunk-z3ffn2b7.js} +851 -324
  71. package/dist/cli/commands/dev.d.ts +8 -0
  72. package/dist/cli/commands/doctor.d.ts +8 -0
  73. package/dist/cli/commands/generate.d.ts +26 -0
  74. package/dist/cli/commands/init.d.ts +13 -1
  75. package/dist/cli/commands/migrate.d.ts +33 -0
  76. package/dist/cli/commands/plugin.d.ts +13 -0
  77. package/dist/cli/commands/seed.d.ts +21 -0
  78. package/dist/cli/{commands/migrate-commands.d.ts → core/migrations/migrate-logic.d.ts} +2 -2
  79. package/dist/cli/core/migrations/schema-diff-engine.d.ts +12 -0
  80. package/dist/cli/core/migrations/schema-diff.d.ts +11 -0
  81. package/dist/cli/{seeding.d.ts → core/seeding/auto-seed.d.ts} +7 -4
  82. package/dist/cli/core/seeding/seed-logic.d.ts +2 -0
  83. package/dist/cli/index.d.ts +4 -0
  84. package/dist/cli/index.js +6 -170
  85. package/dist/client/RichText.d.ts +5 -0
  86. package/dist/client/rich-text-utils.d.ts +5 -0
  87. package/dist/client.js +3 -2
  88. package/dist/config.d.ts +3 -3
  89. package/dist/db/adapter.d.ts +2 -2
  90. package/dist/db/better-sqlite.d.ts +3 -3
  91. package/dist/db/better-sqlite.js +6 -5
  92. package/dist/db/bun-sqlite.d.ts +3 -3
  93. package/dist/db/bun-sqlite.js +6 -5
  94. package/dist/db/d1.d.ts +13 -7
  95. package/dist/db/d1.js +6 -5
  96. package/dist/db/index.d.ts +2 -2
  97. package/dist/db/index.js +10 -12
  98. package/dist/db/kysely/factory.d.ts +29 -0
  99. package/dist/db/kysely/plugins/audit-logging.d.ts +48 -0
  100. package/dist/db/kysely/plugins/auto-timestamps.d.ts +38 -0
  101. package/dist/db/kysely/plugins/cursor-pagination.d.ts +42 -0
  102. package/dist/db/kysely/plugins/deadlock-handler.d.ts +47 -0
  103. package/dist/db/kysely/plugins/draft-swapper.d.ts +33 -0
  104. package/dist/db/kysely/plugins/field-masking.d.ts +45 -0
  105. package/dist/db/kysely/plugins/fts-normalizer.d.ts +38 -0
  106. package/dist/db/kysely/plugins/i18n-fallback.d.ts +48 -0
  107. package/dist/db/kysely/plugins/id-generation.d.ts +42 -0
  108. package/dist/db/kysely/plugins/index.d.ts +16 -0
  109. package/dist/db/kysely/plugins/json-flattener.d.ts +38 -0
  110. package/dist/db/kysely/plugins/relationship-preloading.d.ts +39 -0
  111. package/dist/db/kysely/plugins/slug-generation.d.ts +37 -0
  112. package/dist/db/kysely/plugins/soft-delete.d.ts +42 -0
  113. package/dist/db/kysely/plugins/tree-resolver.d.ts +39 -0
  114. package/dist/db/kysely/plugins/virtual-field-resolver.d.ts +54 -0
  115. package/dist/db/kysely/plugins/zod-coercion.d.ts +34 -0
  116. package/dist/db/kysely/snapshot/snapshot-manager.d.ts +18 -0
  117. package/dist/db/postgres.d.ts +4 -4
  118. package/dist/db/postgres.js +6 -5
  119. package/dist/db/sqlite.d.ts +3 -3
  120. package/dist/db/sqlite.js +6 -5
  121. package/dist/index.d.ts +3 -0
  122. package/dist/index.js +161 -7
  123. package/dist/runtimes/bun.js +9 -6
  124. package/dist/runtimes/cloudflare-workers.d.ts +3 -1
  125. package/dist/runtimes/cloudflare-workers.js +36 -7
  126. package/dist/runtimes/next.js +8 -5
  127. package/dist/runtimes/node.js +9 -6
  128. package/dist/schema/collection.d.ts +116 -70
  129. package/dist/schema/compiler.d.ts +6 -0
  130. package/dist/schema/global.d.ts +38 -71
  131. package/dist/schema/index.d.ts +5 -4
  132. package/dist/schema/index.js +35 -550
  133. package/dist/schema/zod.d.ts +564 -0
  134. package/dist/server/admin-router.d.ts +1 -1
  135. package/dist/server/collection-router.d.ts +1 -1
  136. package/dist/server/graphql.d.ts +6 -0
  137. package/dist/server/handlers.d.ts +25 -7
  138. package/dist/server/middlewares/auth.d.ts +1 -1
  139. package/dist/server/plugins-loader.d.ts +1 -1
  140. package/dist/server/router.d.ts +2 -2
  141. package/dist/server/routers/admin.d.ts +1 -1
  142. package/dist/server/routers/auth.d.ts +1 -1
  143. package/dist/server/routers/collections.d.ts +4 -1
  144. package/dist/server/routers/plugins.d.ts +2 -2
  145. package/dist/server/setup-middlewares.d.ts +1 -1
  146. package/dist/server/system-router.d.ts +1 -1
  147. package/dist/server.js +11 -6
  148. package/dist/storage/adapters/cloudflare-r2.d.ts +11 -2
  149. package/dist/storage/index.js +39 -30
  150. package/dist/types.d.ts +255 -44
  151. package/dist/utils/context.d.ts +14 -0
  152. package/dist/utils/logger.d.ts +2 -0
  153. package/dist/utils/string.d.ts +10 -0
  154. package/dist/utils/webhooks-engine.d.ts +24 -0
  155. package/dist/validation.d.ts +67 -1
  156. package/dist/validator.d.ts +1 -0
  157. package/package.json +36 -33
  158. package/src/cli/index.ts +117 -0
  159. package/dist/chunk-6qq3ne6b.js +0 -288
  160. package/dist/chunk-6v1fw7q7.js +0 -126
  161. package/dist/chunk-7a9kn0np.js +0 -116
  162. package/dist/chunk-bexcv7xe.js +0 -36
  163. package/dist/chunk-d3ffeqp9.js +0 -87
  164. package/dist/chunk-fj19qccp.js +0 -78
  165. package/dist/chunk-j53pz21t.js +0 -20
  166. package/dist/chunk-mkn49zmy.js +0 -102
  167. package/dist/chunk-qb6ztvw9.js +0 -17
  168. package/dist/chunk-r39em4yj.js +0 -29
  169. package/dist/chunk-rsf0tpy1.js +0 -8
  170. package/dist/chunk-srsac177.js +0 -85
  171. package/dist/chunk-swtcpvhf.js +0 -2442
  172. package/dist/chunk-twpvxfce.js +0 -64
  173. package/dist/chunk-ywm4t2gm.js +0 -19
  174. package/dist/cli/commands/plugin-sync.d.ts +0 -1
  175. package/dist/cli/commands/seed-command.d.ts +0 -2
  176. package/dist/plugins/ui-bridge.d.ts +0 -12
  177. package/dist/schema/fields/base.d.ts +0 -84
  178. package/dist/schema/fields/index.d.ts +0 -147
  179. package/dist/schema/infer.d.ts +0 -55
  180. /package/dist/admin/ui/components/{ColumnVisibilityToggle.d.ts → column-visibility-toggle.d.ts} +0 -0
  181. /package/dist/admin/ui/components/{DataDetailView.d.ts → data-detail-view.d.ts} +0 -0
  182. /package/dist/cli/{d1-mock.d.ts → core/mocks/d1-mock.d.ts} +0 -0
  183. /package/dist/cli/{r2-mock.d.ts → core/mocks/r2-mock.d.ts} +0 -0
  184. /package/dist/cli/{commands → core/plugins}/plugin-build.d.ts +0 -0
  185. /package/dist/cli/{commands → core/plugins}/plugin-init.d.ts +0 -0
  186. /package/dist/cli/{commands → core/types}/generate-types.d.ts +0 -0
  187. /package/dist/{schema/fields/validation.test.d.ts → cli/seeding.test.d.ts} +0 -0
@@ -0,0 +1,65 @@
1
+ /**
2
+ * OpacaCMS Plugin Client SDK
3
+ *
4
+ * This SDK provides a secure way for plugins running inside iframes to communicate
5
+ * with the host Admin UI using postMessage.
6
+ */
7
+ export interface OpacaMessage {
8
+ type: string;
9
+ payload?: any;
10
+ }
11
+ export declare const opaca: {
12
+ /**
13
+ * Roteamento (Navigation)
14
+ */
15
+ router: {
16
+ /**
17
+ * Navigates to a specific path in the parent Admin UI.
18
+ */
19
+ push: (path: string) => void;
20
+ /**
21
+ * Refreshes the parent Admin UI router/view.
22
+ */
23
+ refresh: () => void;
24
+ };
25
+ /**
26
+ * Native UI Components
27
+ */
28
+ ui: {
29
+ /**
30
+ * Toast Notifications
31
+ */
32
+ toast: {
33
+ success: (message: string) => void;
34
+ error: (message: string) => void;
35
+ info: (message: string) => void;
36
+ warning: (message: string) => void;
37
+ };
38
+ /**
39
+ * Alert Dialogs
40
+ */
41
+ alert: (options: {
42
+ title: string;
43
+ description?: string;
44
+ variant?: "default" | "destructive";
45
+ }) => void;
46
+ /**
47
+ * Side Sheets (Panéis Deslizantes)
48
+ */
49
+ sheet: {
50
+ /**
51
+ * Opens a side sheet with a specific URL or content.
52
+ */
53
+ open: (options: {
54
+ title: string;
55
+ src: string;
56
+ size?: "sm" | "md" | "lg" | "xl" | "full";
57
+ }) => void;
58
+ /**
59
+ * Closes the current side sheet.
60
+ */
61
+ close: () => void;
62
+ };
63
+ };
64
+ };
65
+ export default opaca;
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type CustomFieldProps } from '../admin/custom-field';
1
+ import React from "react";
2
+ import { type CustomFieldProps } from "../admin/custom-field";
3
3
  export declare function defineReactField<TValue = any, TConfig = Record<string, any>>(tagName: string, Component: React.ComponentType<CustomFieldProps<TValue, TConfig>>): void;
@@ -1,8 +1,38 @@
1
1
  import {
2
- defineReactField
3
- } from "../chunk-bexcv7xe.js";
4
- import"../chunk-rqyjjqgy.js";
5
- import"../chunk-8sqjbsgt.js";
2
+ defineCustomField
3
+ } from "../chunk-rqyjjqgy.js";
4
+ import"../chunk-6bywt602.js";
5
+
6
+ // src/admin/react.tsx
7
+ import React from "react";
8
+ import { createRoot } from "react-dom/client";
9
+ function defineReactField(tagName, Component) {
10
+ defineCustomField(tagName, {
11
+ mount: (container, props) => {
12
+ const el = container;
13
+ const root = createRoot(el);
14
+ el._opacaReactRoot = root;
15
+ root.render(React.createElement(Component, props));
16
+ },
17
+ update: (container, props) => {
18
+ const el = container;
19
+ const root = el._opacaReactRoot;
20
+ if (root) {
21
+ root.render(React.createElement(Component, props));
22
+ }
23
+ },
24
+ unmount: (container) => {
25
+ const el = container;
26
+ const root = el._opacaReactRoot;
27
+ if (root) {
28
+ setTimeout(() => {
29
+ root.unmount();
30
+ delete el._opacaReactRoot;
31
+ }, 0);
32
+ }
33
+ }
34
+ });
35
+ }
6
36
  export {
7
37
  defineReactField
8
38
  };
@@ -1,4 +1,4 @@
1
- import type { IconName } from "../../types";
1
+ import type { LucideIcons } from "../../types";
2
2
  export interface ToastItem {
3
3
  id: string;
4
4
  message: string;
@@ -12,10 +12,25 @@ export declare function notify(message: string, type?: ToastItem["type"]): void;
12
12
  export declare function clearToast(id: string): void;
13
13
  export interface SidebarItem {
14
14
  label: string;
15
- icon?: IconName | string;
15
+ icon?: LucideIcons | string;
16
16
  path: string;
17
- component?: string;
18
- render?: (serverUrl: string, config: any, user: any) => string;
17
+ ssrPath?: string;
19
18
  }
20
19
  export declare const $customSidebarItems: import("nanostores").PreinitializedWritableAtom<SidebarItem[]> & object;
21
20
  export declare function registerSidebarItem(item: SidebarItem): void;
21
+ export interface AlertOptions {
22
+ title: string;
23
+ description?: string;
24
+ variant?: "default" | "destructive";
25
+ }
26
+ export declare const $activeAlert: import("nanostores").PreinitializedWritableAtom<AlertOptions | null> & object;
27
+ export declare function openAlert(options: AlertOptions): void;
28
+ export declare function closeAlert(): void;
29
+ export interface SheetOptions {
30
+ title: string;
31
+ src: string;
32
+ size?: "sm" | "md" | "lg" | "xl" | "full";
33
+ }
34
+ export declare const $activeSheet: import("nanostores").PreinitializedWritableAtom<SheetOptions | null> & object;
35
+ export declare function openSheet(options: SheetOptions): void;
36
+ export declare function closeSheet(): void;
@@ -5,7 +5,7 @@ interface PluginSettingsFormProps {
5
5
  configSchema?: any[];
6
6
  };
7
7
  onBack: () => void;
8
- notify?: (message: string, type?: 'success' | 'error') => void;
8
+ notify?: (message: string, type?: "success" | "error") => void;
9
9
  }
10
- export declare function PluginSettingsForm({ plugin, onBack, notify, }: PluginSettingsFormProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function PluginSettingsForm({ plugin, onBack, notify }: PluginSettingsFormProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -0,0 +1,7 @@
1
+ export declare const CustomAlert: ({ children, title, description, onConfirm, onCancel, }: {
2
+ children: React.ReactNode;
3
+ title: string;
4
+ description: string;
5
+ onConfirm: () => void;
6
+ onCancel: () => void;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
1
  import type React from "react";
2
2
  import "../../../admin/ui/styles/data-detail.scss";
3
3
  interface DetailSheetProps {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
4
  title: string;
7
5
  description?: string;
8
6
  data?: any;
@@ -10,6 +8,7 @@ interface DetailSheetProps {
10
8
  id?: string | number;
11
9
  onSave?: (updatedData: any) => void;
12
10
  field?: string;
11
+ children: React.ReactNode;
13
12
  }
14
13
  /**
15
14
  * Universal sheet for viewing and editing document or data details.
@@ -1,4 +1,4 @@
1
- import type React from 'react';
1
+ import type React from "react";
2
2
  interface FieldLabelProps {
3
3
  name: string;
4
4
  label?: string;
@@ -1,4 +1,4 @@
1
- import type React from 'react';
1
+ import type React from "react";
2
2
  interface RelationshipFieldProps {
3
3
  name: string;
4
4
  label?: string;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import '../../../../admin/ui/styles/asset-manager.scss';
1
+ import React from "react";
2
+ import "../../../../admin/ui/styles/asset-manager.scss";
3
3
  interface AssetManagerProps {
4
4
  onSelect: (asset: {
5
5
  assetId: string;
@@ -0,0 +1,7 @@
1
+ interface PluginIframeProps {
2
+ src: string;
3
+ title: string;
4
+ label?: string;
5
+ }
6
+ export declare function PluginIframe({ src, title, label }: PluginIframeProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1,11 +1,21 @@
1
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
1
2
  import * as React from "react";
2
- import "../../../../admin/ui/styles/accordion.scss";
3
- interface AccordionProps {
4
- title: string;
3
+ declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
4
+ declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ /**
8
+ * Custom Accordion helper for easy implementation.
9
+ * API similar to DetailSheet where trigger can be passed as a prop or children.
10
+ */
11
+ interface CustomAccordionProps {
12
+ title?: React.ReactNode;
5
13
  children: React.ReactNode;
6
- defaultOpen?: boolean;
14
+ trigger?: React.ReactNode;
15
+ value?: string;
7
16
  className?: string;
8
- isCollapsed?: boolean;
17
+ type?: "single" | "multiple";
18
+ collapsible?: boolean;
9
19
  }
10
- export declare const Accordion: ({ title, children, defaultOpen, className, isCollapsed, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
20
+ export declare function CustomAccordion({ title, children, trigger, value, className, type, collapsible, }: CustomAccordionProps): import("react/jsx-runtime").JSX.Element;
21
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
@@ -1,12 +1,16 @@
1
- import { type ReactNode } from "react";
2
- export interface AlertDialogProps {
3
- children?: ReactNode;
4
- trigger?: ReactNode;
5
- title: string;
6
- description: string;
7
- onConfirm: () => void;
8
- confirmText?: string;
9
- cancelText?: string;
10
- variant?: "default" | "destructive";
11
- }
12
- export declare function AlertDialog({ children, trigger, title, description, onConfirm, confirmText, cancelText, variant, }: AlertDialogProps): import("react/jsx-runtime").JSX.Element;
1
+ import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ import { Button } from "./button";
4
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
7
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
9
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
13
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
14
+ declare function AlertDialogAction({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): import("react/jsx-runtime").JSX.Element;
15
+ declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): import("react/jsx-runtime").JSX.Element;
16
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -1,7 +1,11 @@
1
- import * as React from "react";
2
- import "../../../../admin/ui/styles/button.scss";
3
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
5
- size?: "default" | "sm" | "lg" | "icon";
6
- }
7
- export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ import "../../styles/button.scss";
4
+ declare const buttonVariants: (props?: ({
5
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
6
+ size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | "xs" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
9
+ asChild?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export { Button, buttonVariants };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import * as React from "react";
2
2
  export interface RelationshipProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
3
  label?: string;
4
4
  relationTo: string;
@@ -1,28 +1,15 @@
1
+ import { Dialog as SheetPrimitive } from "radix-ui";
1
2
  import type * as React from "react";
2
- import "../../../../admin/ui/styles/sheet.scss";
3
- export declare function Sheet({ open, onOpenChange, children, }: {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
- children: React.ReactNode;
7
- }): React.ReactPortal | null;
8
- export declare function SheetContent({ children, className, onClose, }: {
9
- children: React.ReactNode;
10
- className?: string;
11
- onClose?: () => void;
12
- }): import("react/jsx-runtime").JSX.Element;
13
- export declare function SheetHeader({ children, className, }: {
14
- children: React.ReactNode;
15
- className?: string;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- export declare function SheetTitle({ children, className, }: {
18
- children: React.ReactNode;
19
- className?: string;
20
- }): import("react/jsx-runtime").JSX.Element;
21
- export declare function SheetDescription({ children, className, }: {
22
- children: React.ReactNode;
23
- className?: string;
24
- }): import("react/jsx-runtime").JSX.Element;
25
- export declare function SheetFooter({ children, className, }: {
26
- children: React.ReactNode;
27
- className?: string;
28
- }): import("react/jsx-runtime").JSX.Element;
3
+ import "../../styles/sheet.scss";
4
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function SheetContent({ className, children, side, showCloseButton, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
8
+ side?: "top" | "right" | "bottom" | "left";
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
15
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
@@ -0,0 +1,7 @@
1
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
2
+ import type * as React from "react";
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -1,11 +1,10 @@
1
- import type { SerializableCollection } from '../../../types';
2
- import '../../../admin/ui/styles/versions.scss';
1
+ import type { SerializableCollection } from "../../../types";
2
+ import "../../../admin/ui/styles/versions.scss";
3
3
  interface VersionsSheetProps {
4
4
  collection: SerializableCollection;
5
5
  parentId: string;
6
- open: boolean;
7
- onOpenChange: (open: boolean) => void;
8
6
  onRestore: (data: Record<string, any>) => void;
7
+ children: React.ReactNode;
9
8
  }
10
- export declare function VersionsSheet({ collection, parentId, open, onOpenChange, onRestore, }: VersionsSheetProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function VersionsSheet({ collection, parentId, onRestore, children }: VersionsSheetProps): import("react/jsx-runtime").JSX.Element;
11
10
  export {};
@@ -1,4 +1,4 @@
1
- import type { SerializableCollection } from "../../../types";
1
+ import type { SerializableCollection } from '../../../types';
2
2
  export interface CollectionListViewProps {
3
3
  collection: SerializableCollection;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { SerializableConfig } from "../../../types";
1
+ import type { SerializableConfig } from '../../../types';
2
2
  export interface DashboardViewProps {
3
3
  config: SerializableConfig;
4
4
  user?: {
@@ -1,7 +1,7 @@
1
- import type { SerializableCollection, SerializableConfig } from "../../../types";
2
- import "../../../admin/ui/styles/media-registry.scss";
1
+ import type { SerializableCollection, SerializableConfig } from '../../../types';
2
+ import '../../../admin/ui/styles/media-registry.scss';
3
3
  export interface MediaRegistryViewProps {
4
4
  collection: SerializableCollection;
5
5
  config: SerializableConfig;
6
6
  }
7
- export declare function MediaRegistryView({ collection, config }: MediaRegistryViewProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function MediaRegistryView({ collection, config, }: MediaRegistryViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import type { SerializableConfig } from '../../../types';
2
- import type { ToastType } from '../../../admin/stores/ui';
1
+ import type { ToastType } from "../../../admin/stores/ui";
2
+ import type { SerializableConfig } from "../../../types";
3
3
  export interface SettingsViewProps {
4
4
  notify?: (message: string, type?: ToastType) => void;
5
5
  config: SerializableConfig;
package/dist/admin/vue.js CHANGED
@@ -1,8 +1,31 @@
1
1
  import {
2
- defineVueField
3
- } from "../chunk-r39em4yj.js";
4
- import"../chunk-rqyjjqgy.js";
5
- import"../chunk-8sqjbsgt.js";
2
+ defineCustomField
3
+ } from "../chunk-rqyjjqgy.js";
4
+ import"../chunk-6bywt602.js";
5
+
6
+ // src/admin/vue.tsx
7
+ function defineVueField(tagName, Component, options) {
8
+ defineCustomField(tagName, {
9
+ mount: (container, props) => {
10
+ const app = options.createApp(Component, props);
11
+ container._opacaVueApp = app;
12
+ app.mount(container);
13
+ },
14
+ update: (container, props) => {
15
+ const app = container._opacaVueApp;
16
+ if (app && app._instance) {
17
+ Object.assign(app._instance.props, props);
18
+ }
19
+ },
20
+ unmount: (container) => {
21
+ const app = container._opacaVueApp;
22
+ if (app) {
23
+ app.unmount();
24
+ delete container._opacaVueApp;
25
+ }
26
+ }
27
+ });
28
+ }
6
29
  export {
7
30
  defineVueField
8
31
  };