@object-ui/components 6.2.0 → 6.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.
@@ -16,3 +16,4 @@ export { useRelatedCount, RelatedCountStore } from './hooks/related-count-store'
16
16
  export type { ControlType, ConfigField, ConfigSection, ConfigPanelSchema, } from './types/config-panel';
17
17
  export declare function initializeComponents(): boolean;
18
18
  export * from './debug';
19
+ export * from './share';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * Spec-aligned renderers for the `element:*` component namespace defined
9
+ * by `@objectstack/spec` (`framework/packages/spec/src/ui/component.zod.ts`).
10
+ *
11
+ * Maps:
12
+ * - ElementTextProps -> element:text
13
+ * - ElementNumberProps -> element:number (object aggregate)
14
+ * - ElementImageProps -> element:image
15
+ * - element:divider (no-props separator)
16
+ * - ElementButtonProps -> element:button
17
+ *
18
+ * Heavier interactive elements (element:filter, element:form,
19
+ * element:record_picker) live in their owning plugins and are left to
20
+ * those packages.
21
+ *
22
+ * All props are read off `schema.properties` per the spec's
23
+ * `UIComponent.properties` convention; `schema.props` is also accepted
24
+ * as a fallback so authors transitioning between conventions keep working.
25
+ */
26
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * ObjectUI — ShareDialog
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * Platform-level share-link dialog. Mirrors the "anyone with the link"
6
+ * pattern from Notion / Figma:
7
+ *
8
+ * • Object opts in via `publicSharing.enabled` on the spec.
9
+ * • Each record can mint one or more capability tokens.
10
+ * • Tokens carry a permission, an audience, an optional expiry,
11
+ * an optional password, and an optional email allowlist.
12
+ *
13
+ * The dialog is intentionally driven by props rather than a hook so it
14
+ * can be reused from the AI page, the floating chatbot panel, record
15
+ * detail views, and any other surface — all of which already know their
16
+ * `apiBase`, `objectName`, and `recordId`.
17
+ */
18
+ export type ShareLinkPermission = 'view' | 'comment' | 'edit';
19
+ export type ShareLinkAudience = 'link_only' | 'signed_in' | 'workspace' | 'email_allowlist';
20
+ export interface ShareLink {
21
+ id: string;
22
+ token: string;
23
+ object_name: string;
24
+ record_id: string;
25
+ permission: ShareLinkPermission;
26
+ audience: ShareLinkAudience;
27
+ expires_at?: string | null;
28
+ password_protected?: boolean;
29
+ label?: string | null;
30
+ revoked_at?: string | null;
31
+ created_at?: string | null;
32
+ last_used_at?: string | null;
33
+ use_count?: number;
34
+ }
35
+ export interface ShareDialogProps {
36
+ open: boolean;
37
+ onOpenChange: (open: boolean) => void;
38
+ /** Object machine name, e.g. `'ai_conversations'`. */
39
+ objectName: string;
40
+ /** Record primary key. */
41
+ recordId: string;
42
+ /** Human label used in the dialog header (defaults to "this record"). */
43
+ recordLabel?: string;
44
+ /** Absolute API base for the framework, e.g. `'/api'`. */
45
+ apiBase: string;
46
+ /**
47
+ * Where the public landing page lives, used to build the copyable URL.
48
+ * Defaults to `${origin}/s/:token`.
49
+ */
50
+ publicBaseUrl?: string;
51
+ /** Extra headers merged into every fetch (auth, tenant, etc). */
52
+ fetchHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
53
+ }
54
+ export declare function ShareDialog({ open, onOpenChange, objectName, recordId, recordLabel, apiBase, publicBaseUrl, fetchHeaders, }: ShareDialogProps): import("react/jsx-runtime").JSX.Element;
55
+ export default ShareDialog;
@@ -0,0 +1,2 @@
1
+ export { ShareDialog, type ShareDialogProps, type ShareLink, type ShareLinkAudience, type ShareLinkPermission, } from './ShareDialog';
2
+ export { default } from './ShareDialog';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/components",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Standard UI component library for Object UI, built with Shadcn UI + Tailwind CSS",
@@ -69,10 +69,10 @@
69
69
  "tailwind-merge": "^3.6.0",
70
70
  "tailwindcss-animate": "^1.0.7",
71
71
  "vaul": "^1.1.2",
72
- "@object-ui/core": "6.2.0",
73
- "@object-ui/i18n": "6.2.0",
74
- "@object-ui/react": "6.2.0",
75
- "@object-ui/types": "6.2.0"
72
+ "@object-ui/core": "6.2.2",
73
+ "@object-ui/i18n": "6.2.2",
74
+ "@object-ui/react": "6.2.2",
75
+ "@object-ui/types": "6.2.2"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": "^18.0.0 || ^19.0.0",