@jini-ai/admin 0.6.15-rc.1 → 0.6.15
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/dist/agent-plugins/adapters/memory.js +9 -3
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +1 -1
- package/dist/agent-plugins/controllers/agent-plugins.controller.js +14 -5
- package/dist/agent-plugins/package-file-tree.js +4 -6
- package/dist/agent-plugins/react/components/AgentPluginInspector.js +5 -2
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +10 -4
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +8 -5
- package/dist/agent-plugins/rules.js +3 -1
- package/dist/comments/adapters/http.js +2 -1
- package/dist/comments/adapters/memory.js +3 -1
- package/dist/comments/conformance/comments-api.conformance.js +3 -2
- package/dist/comments/controllers/comment-queue.controller.d.ts +1 -1
- package/dist/comments/controllers/comment-queue.controller.js +4 -2
- package/dist/core/entities/rules.js +13 -20
- package/dist/core/module/create-admin.js +2 -1
- package/dist/core/omit-keys.d.ts +7 -0
- package/dist/core/omit-keys.js +12 -0
- package/dist/core/ports/forms.d.ts +5 -3
- package/dist/core/transport/query-suffix.d.ts +3 -0
- package/dist/core/transport/query-suffix.js +5 -0
- package/dist/forms/adapters/http.js +3 -2
- package/dist/forms/adapters/memory.js +3 -2
- package/dist/forms/controllers/field-attributes-dialog.controller.js +17 -3
- package/dist/forms/controllers/form-fields-editor.controller.js +1 -2
- package/dist/forms/controllers/form-submission-detail.controller.js +1 -2
- package/dist/forms/controllers/form-submissions.controller.js +1 -2
- package/dist/forms/controllers/forms-list.controller.js +1 -2
- package/dist/forms/field-settings.js +15 -4
- package/dist/forms/html-rules.js +10 -13
- package/dist/forms/react/hooks/forms-view.hooks.d.ts +2 -2
- package/dist/forms/react/hooks/forms-view.hooks.js +9 -1
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +1 -3
- package/dist/forms/react/hooks/use-form-editor.hooks.js +8 -9
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +1 -4
- package/dist/forms/react/hooks/use-form-submissions.hooks.js +1 -5
- package/dist/forms/react/hooks/use-forms-list.hooks.js +1 -2
- package/dist/forms/rules.js +7 -2
- package/dist/media/adapters/memory.js +5 -3
- package/dist/media/controllers/library.controller.js +4 -2
- package/dist/media/controllers/providers.controller.js +2 -1
- package/dist/media/html-attributes.d.ts +1 -8
- package/dist/media/html-attributes.js +6 -161
- package/dist/media/react/components/MediaCard.js +11 -1
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +18 -7
- package/dist/media/react/hooks/LibraryTab.hooks.js +3 -2
- package/dist/media/react/hooks/ProvidersTab.hooks.js +19 -9
- package/dist/media/rules.js +6 -3
- package/dist/playground/adapters/memory.js +26 -7
- package/dist/playground/conformance/playground-api.conformance.js +6 -3
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -2
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +1 -1
- package/dist/react/components/ConfirmButton/ConfirmButton.js +2 -5
- package/dist/react/components/ConfirmDialog/confirm-dialog-attrs.js +2 -2
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +3 -1
- package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -8
- package/dist/react/components/Sidebar.js +1 -1
- package/dist/react/entities/EntityField.js +1 -0
- package/dist/react/entities/contribution.js +2 -1
- package/dist/react/entities/types.js +1 -1
- package/dist/react/overlays.js +2 -1
- package/dist/react/shell/AdminShell.hooks.js +1 -1
- package/dist/react/shell/use-admin-shell-session.js +2 -1
- package/dist/react/shell/use-admin-theme.js +6 -6
- package/dist/redirects/adapters/memory.js +16 -13
- package/dist/security/adapters/http.js +10 -11
- package/dist/security/adapters/memory.js +50 -15
- package/dist/security/conformance/security-api.conformance.js +6 -3
- package/dist/security/controllers/access-tokens.controller.js +7 -3
- package/dist/security/controllers/other-credentials.controller.js +4 -2
- package/dist/security/controllers/root-key.controller.js +12 -5
- package/dist/security/react/hooks/AccessTokensTab.hooks.js +8 -3
- package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -2
- package/dist/security/rules.js +19 -5
- package/dist/seo/adapters/memory.js +5 -2
- package/dist/seo/controllers/seo-entry.controller.js +2 -1
- package/dist/seo/controllers/sitemap.controller.js +2 -1
- package/dist/seo/react/hooks/MediaPickerBridge.hooks.js +1 -1
- package/dist/seo/react/hooks/SeoPage.hooks.d.ts +1 -21
- package/dist/seo/react/hooks/SeoPage.hooks.js +0 -8
- package/dist/seo/react/hooks/use-seo.hooks.js +1 -1
- package/dist/seo/react/hooks/use-share-image-warning.hooks.js +1 -1
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +9 -1
- package/dist/seo/react/pages/SeoPage.js +17 -3
- package/dist/source-control/adapters/memory.js +30 -14
- package/dist/source-control/controllers/source-control.controller.js +5 -2
- package/dist/source-control/react/components/SourceControlProviderRow.js +6 -1
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -2
- package/dist/source-control/rules.js +9 -3
- package/dist/widgets/adapters/http.js +2 -1
- package/dist/widgets/adapters/memory.js +4 -2
- package/dist/widgets/conformance/widgets-api.conformance.js +5 -2
- package/dist/widgets/controllers/instance-editor.controller.js +3 -2
- package/dist/widgets/controllers/library.controller.js +2 -1
- package/dist/widgets/controllers/region-editor.controller.js +2 -1
- package/dist/widgets/controllers/regions.controller.js +2 -1
- package/dist/widgets/react/components/WidgetInstanceNotices.d.ts +1 -1
- package/dist/widgets/react/components/WidgetInstanceNotices.js +2 -0
- package/dist/widgets/react/hooks/use-widget-regions.hooks.js +5 -2
- package/dist/widgets/react/hooks/use-widgets-library.hooks.js +5 -2
- package/dist/widgets/react/pages/WidgetInstanceEditor.js +1 -1
- package/dist/widgets/react/pages/WidgetRegionEditor.js +1 -1
- package/dist/widgets/react/pages/WidgetsLibrary.js +1 -1
- package/dist/widgets/rules.js +5 -1
- package/package.json +13 -13
|
@@ -13,8 +13,11 @@ export function useWidgetRegions({ api }, { t = widgetsEnglish, events, navigate
|
|
|
13
13
|
const latest = useRef({ t, navigate });
|
|
14
14
|
latest.current = { t, navigate };
|
|
15
15
|
const { controller, snapshot } = useController({ create: () => createWidgetRegionsController({ api: cached.api }, { t: key => latest.current.t(key), navigate: path => latest.current.navigate?.(path) }), dependencies: [cached.api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!controller)
|
|
18
|
+
return undefined;
|
|
19
|
+
return events?.subscribe({ resource: WIDGETS_REGIONS_RESOURCE, onRefresh: () => invalidate({ key: WIDGET_QUERY_KEYS.regions }) });
|
|
20
|
+
}, [controller, events, invalidate]);
|
|
18
21
|
return { ...mergeRegionsState({ snapshot, data: cached.query.data, queryError: cached.query.error }), setNewRegionKey: value => controller?.setNewRegionKey({ value }), bind: async () => { await controller?.bind(); }, t };
|
|
19
22
|
}
|
|
20
23
|
const EMPTY_REGIONS_STATE = { regions: null, error: null, newRegionKey: '', binding: false };
|
|
@@ -12,8 +12,11 @@ export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en',
|
|
|
12
12
|
const latestT = useRef(t);
|
|
13
13
|
latestT.current = t;
|
|
14
14
|
const { controller, snapshot } = useController({ create: () => createWidgetsLibraryController({ api: cached.api }, { t: key => latestT.current(key) }), dependencies: [cached.api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!controller)
|
|
17
|
+
return undefined;
|
|
18
|
+
return events?.subscribe({ resource: WIDGETS_LIBRARY_RESOURCE, onRefresh: () => invalidate({ key: WIDGET_QUERY_KEYS.library }) });
|
|
19
|
+
}, [controller, events, invalidate]);
|
|
17
20
|
return { ...mergeLibraryState({ snapshot, data: cached.query.data, queryError: cached.query.error }),
|
|
18
21
|
setCreateType: type => controller?.setCreateType({ type }), requestTrash: widget => controller?.requestTrash({ widget }),
|
|
19
22
|
confirmTrash: async () => { await controller?.confirmTrash(); }, cancelTrash: () => controller?.cancelTrash(), t, locale };
|
|
@@ -18,7 +18,7 @@ import { WhereUsedBanner, WidgetInstanceGuardNotice } from '../components/Widget
|
|
|
18
18
|
export function WidgetInstanceEditor(props) {
|
|
19
19
|
const { slots: { ConfigFields: WidgetConfigFields }, widgetTypes } = useWidgetsOptions();
|
|
20
20
|
const { widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook = useWiredWidgetInstanceEditor } = props;
|
|
21
|
-
const { isNew, widget, whereUsed, title, setTitle, config, setConfig, message, error, fieldErrors,
|
|
21
|
+
const { isNew, widget, whereUsed, title, setTitle, config, setConfig, message, error, fieldErrors, saving, save, t, gate, onBackClick, } = useWidgetInstanceEditorView({ widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook, widgetTypes });
|
|
22
22
|
if (gate.guard !== null)
|
|
23
23
|
return _jsx(WidgetInstanceGuardNotice, { guard: gate.guard, t: t });
|
|
24
24
|
// `widgetInstanceGuard`'s "no-type" case already covers a null `widgetType` above, but TS can't
|
|
@@ -9,7 +9,7 @@ import { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEdito
|
|
|
9
9
|
export function WidgetRegionEditor(props) {
|
|
10
10
|
const { slots: { AddControl: WidgetAddControl }, widgetTypes } = useWidgetsOptions();
|
|
11
11
|
const { regionKey, useWidgetRegionEditorHook = useWiredWidgetRegionEditor } = props;
|
|
12
|
-
const { area, placements, message, error, loading, saving, removeAt, moveAt, toggleEnabled, addPlacement, save, t,
|
|
12
|
+
const { area, placements, message, error, loading, saving, removeAt, moveAt, toggleEnabled, addPlacement, save, t, placementHandles } = useWidgetRegionEditorView({ regionKey, useWidgetRegionEditorHook });
|
|
13
13
|
if (error && !area)
|
|
14
14
|
return _jsx("div", { className: "notice error", children: error });
|
|
15
15
|
if (loading)
|
|
@@ -11,7 +11,7 @@ export { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
|
11
11
|
import { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
12
12
|
export function WidgetsLibrary({ useWidgetsLibraryHook = useWiredWidgetsLibrary } = {}) {
|
|
13
13
|
const { widgetTypes, headerActions, statusLabel } = useWidgetsOptions();
|
|
14
|
-
const { widgets, error, skippedCount, skippedIds, createType, setCreateType, pendingTrash, trashing, requestTrash, confirmTrash, cancelTrash, t,
|
|
14
|
+
const { widgets, error, skippedCount, skippedIds, createType, setCreateType, pendingTrash, trashing, requestTrash, confirmTrash, cancelTrash, t, rowHandleById, } = useWidgetsLibraryView({ useWidgetsLibraryHook });
|
|
15
15
|
if (error && !widgets)
|
|
16
16
|
return _jsx("div", { className: "notice error", children: error });
|
|
17
17
|
if (!widgets)
|
package/dist/widgets/rules.js
CHANGED
|
@@ -43,8 +43,12 @@ export function movePlacement({ items, index, direction }, _optional = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
// Distinguishes draft keys created in the same millisecond without randomUUID.
|
|
45
45
|
let draftPlacementSequence = 0;
|
|
46
|
+
function fallbackDraftPlacementId() {
|
|
47
|
+
draftPlacementSequence += 1;
|
|
48
|
+
return `p-${Date.now()}-${draftPlacementSequence}`;
|
|
49
|
+
}
|
|
46
50
|
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements. */
|
|
47
|
-
export function buildDraftPlacement({ widgetInstanceId }, { id = () => globalThis.crypto?.randomUUID?.() ??
|
|
51
|
+
export function buildDraftPlacement({ widgetInstanceId }, { id = () => globalThis.crypto?.randomUUID?.() ?? fallbackDraftPlacementId() } = {}) {
|
|
48
52
|
return { placementId: id(), widgetEntryId: widgetInstanceId, enabled: true, widgetTitle: null, widgetType: null, broken: false };
|
|
49
53
|
}
|
|
50
54
|
/** Conflict copy is domain-specific; other failures use the existing admin error describer. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/admin",
|
|
3
|
-
"version": "0.6.15
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "Composable admin surface for Jini-hosted products: framework-free contracts, panel registry, and route model in `/core`; React shell and panels in `/react`. Import only the layers you need.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -448,12 +448,12 @@
|
|
|
448
448
|
"peerDependencies": {
|
|
449
449
|
"react": "^18.3.0 || ^19.0.0",
|
|
450
450
|
"react-dom": "^18.3.0 || ^19.0.0",
|
|
451
|
-
"@jini-ai/agentic": "^0.6.
|
|
452
|
-
"@jini-ai/ui": "^0.6.
|
|
453
|
-
"@jini-ai/ui-kit": "^0.6.
|
|
454
|
-
"@jini-ai/agent-plugins": "^0.6.
|
|
455
|
-
"@jini-ai/cms": "^0.6.
|
|
456
|
-
"@jini-ai/core": "^0.6.
|
|
451
|
+
"@jini-ai/agentic": "^0.6.10",
|
|
452
|
+
"@jini-ai/ui": "^0.6.10",
|
|
453
|
+
"@jini-ai/ui-kit": "^0.6.10",
|
|
454
|
+
"@jini-ai/agent-plugins": "^0.6.10",
|
|
455
|
+
"@jini-ai/cms": "^0.6.10",
|
|
456
|
+
"@jini-ai/core": "^0.6.10"
|
|
457
457
|
},
|
|
458
458
|
"peerDependenciesMeta": {
|
|
459
459
|
"react": {
|
|
@@ -491,12 +491,12 @@
|
|
|
491
491
|
"react": "^19.2.0",
|
|
492
492
|
"react-dom": "^19.2.0",
|
|
493
493
|
"@testing-library/user-event": "^14.6.1",
|
|
494
|
-
"@jini-ai/
|
|
495
|
-
"@jini-ai/
|
|
496
|
-
"@jini-ai/
|
|
497
|
-
"@jini-ai/
|
|
498
|
-
"@jini-ai/
|
|
499
|
-
"@jini-ai/
|
|
494
|
+
"@jini-ai/agentic": "^0.6.15",
|
|
495
|
+
"@jini-ai/agent-plugins": "^0.6.15",
|
|
496
|
+
"@jini-ai/ui-kit": "^0.6.15",
|
|
497
|
+
"@jini-ai/cms": "^0.6.15",
|
|
498
|
+
"@jini-ai/core": "^0.6.15",
|
|
499
|
+
"@jini-ai/ui": "^0.6.15"
|
|
500
500
|
},
|
|
501
501
|
"typesVersions": {
|
|
502
502
|
"*": {
|