@jini-ai/admin 0.4.4 → 0.4.6
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/package-file-tree.d.ts +3 -1
- package/dist/agent-plugins/package-file-tree.js +7 -7
- package/dist/comments/controllers/comment-queue.controller.d.ts +5 -1
- package/dist/comments/controllers/comment-queue.controller.js +2 -2
- package/dist/comments/react/hooks/use-comment-queue.hooks.js +14 -3
- package/dist/consent/react/ConsentSettingsPanel.d.ts +27 -0
- package/dist/consent/react/ConsentSettingsPanel.js +24 -0
- package/dist/consent/react/index.d.ts +3 -0
- package/dist/consent/react/index.js +2 -0
- package/dist/consent/react/settings-panel.hooks.d.ts +19 -0
- package/dist/consent/react/settings-panel.hooks.js +30 -0
- package/dist/core/ports/forms.d.ts +23 -3
- package/dist/core/ports/forms.js +3 -3
- package/dist/core/ports/seo.d.ts +17 -0
- package/dist/forms/adapters/http.d.ts +5 -2
- package/dist/forms/adapters/http.js +7 -2
- package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +59 -1
- package/dist/forms/controllers/field-attributes-dialog.controller.js +27 -2
- package/dist/forms/field-settings.d.ts +142 -0
- package/dist/forms/field-settings.js +327 -0
- package/dist/forms/form-editor-dirty.d.ts +42 -0
- package/dist/forms/form-editor-dirty.js +25 -0
- package/dist/forms/forms.module.d.ts +72 -0
- package/dist/forms/html-rules.d.ts +41 -3
- package/dist/forms/html-rules.js +118 -17
- package/dist/forms/messages.en.d.ts +72 -0
- package/dist/forms/messages.en.js +73 -0
- package/dist/forms/react/components/FieldAttributesDialog.js +20 -19
- package/dist/forms/react/components/FieldSettingsSection.d.ts +19 -0
- package/dist/forms/react/components/FieldSettingsSection.js +21 -0
- package/dist/forms/react/components/FormFieldsEditor.js +7 -8
- package/dist/forms/react/components/FormSubmissionDetail.js +5 -2
- package/dist/forms/react/hooks/forms-view.hooks.d.ts +75 -5
- package/dist/forms/react/hooks/forms-view.hooks.js +46 -2
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +10 -0
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +12 -2
- package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +11 -0
- package/dist/forms/react/hooks/use-form-editor.hooks.js +25 -2
- package/dist/forms/react/hooks/use-form-fields-editor.hooks.d.ts +2 -0
- package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +5 -1
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +4 -0
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +1 -0
- package/dist/forms/react/index.d.ts +216 -0
- package/dist/forms/react/index.js +3 -1
- package/dist/forms/react/pages/FormEditor.js +3 -2
- package/dist/forms/rules.d.ts +10 -1
- package/dist/forms/rules.js +8 -1
- package/dist/media/controllers/library.controller.d.ts +4 -0
- package/dist/media/controllers/library.controller.js +13 -0
- package/dist/media/react/components/MediaPicker.js +2 -2
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +4 -2
- package/dist/media/react/hooks/GallerySelection.hooks.d.ts +31 -0
- package/dist/media/react/hooks/GallerySelection.hooks.js +32 -0
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +4 -0
- package/dist/media/react/hooks/LibraryTab.hooks.js +9 -3
- package/dist/media/react/hooks/MediaCard.hooks.d.ts +2 -2
- package/dist/media/react/hooks/MediaGrid.hooks.d.ts +2 -2
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +4 -0
- package/dist/media/react/hooks/MediaPage.hooks.js +10 -13
- package/dist/media/react/hooks/MediaPicker.hooks.js +5 -1
- package/dist/media/react/hooks/MediaQuery.hooks.d.ts +27 -0
- package/dist/media/react/hooks/MediaQuery.hooks.js +41 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.js +21 -2
- package/dist/media/react/index.d.ts +1 -0
- package/dist/media/react/index.js +1 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +3 -1
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +5 -1
- package/dist/react/components/ConfirmDialog/use-confirm-request.d.ts +22 -0
- package/dist/react/components/ConfirmDialog/use-confirm-request.js +53 -0
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +5 -0
- package/dist/react/components/Sidebar.d.ts +6 -0
- package/dist/react/components/Sidebar.js +1 -0
- package/dist/react/entities/use-entity-edit.d.ts +1 -1
- package/dist/react/hooks/use-sidebar-rail.d.ts +10 -1
- package/dist/react/hooks/use-sidebar-rail.js +16 -3
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +1 -0
- package/dist/seo/adapters/http.d.ts +11 -1
- package/dist/seo/adapters/http.js +11 -1
- package/dist/seo/controllers/entry-picker.controller.d.ts +2 -0
- package/dist/seo/controllers/entry-picker.controller.js +2 -0
- package/dist/seo/models.d.ts +8 -0
- package/dist/seo/react/components/MediaRefField.js +2 -2
- package/dist/seo/react/hooks/MediaRefField.hooks.d.ts +4 -2
- package/dist/seo/react/hooks/MediaRefField.hooks.js +8 -3
- package/dist/seo/react/hooks/SeoQuery.hooks.d.ts +42 -0
- package/dist/seo/react/hooks/SeoQuery.hooks.js +65 -0
- package/dist/seo/react/hooks/use-entry-picker.hooks.js +7 -9
- package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +9 -2
- package/dist/seo/react/hooks/use-seo.hooks.js +22 -4
- package/dist/seo/react/hooks/use-share-image-warning.hooks.d.ts +19 -0
- package/dist/seo/react/hooks/use-share-image-warning.hooks.js +79 -0
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +5 -3
- package/dist/seo/react/pages/SeoPage.js +1 -1
- package/dist/seo/rules.d.ts +21 -2
- package/dist/seo/rules.js +44 -4
- package/dist/widgets/react/hooks/WidgetsQuery.hooks.d.ts +37 -0
- package/dist/widgets/react/hooks/WidgetsQuery.hooks.js +70 -0
- package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +5 -3
- package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +3 -1
- package/dist/widgets/react/hooks/use-widget-regions.hooks.js +7 -3
- package/dist/widgets/react/hooks/use-widgets-library.hooks.js +7 -3
- package/package.json +20 -14
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useWidgetRegionQuery } from './WidgetsQuery.hooks.js';
|
|
1
2
|
import { useEffect, useRef } from 'react';
|
|
2
3
|
import { useController } from '../../../core/react/use-controller.js';
|
|
3
4
|
import { createWidgetRegionEditorController } from '../../controllers/region-editor.controller.js';
|
|
@@ -5,9 +6,10 @@ import { widgetsEnglish } from '../../messages.en.js';
|
|
|
5
6
|
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
6
7
|
export function staleVersionMessage({ t = widgetsEnglish } = {}, _optional = {}) { return t('This region changed since you loaded it, refresh and try again.'); }
|
|
7
8
|
export function useWidgetRegionEditor({ regionKey, api }, { t = widgetsEnglish, locale = 'en' } = {}) {
|
|
9
|
+
const cachedApi = useWidgetRegionQuery({ api, regionKey });
|
|
8
10
|
const keyRef = useRef(regionKey), latestT = useRef(t);
|
|
9
11
|
latestT.current = t;
|
|
10
|
-
const { controller, snapshot } = useController({ create: () => createWidgetRegionEditorController({ api, regionKey: keyRef.current }, { t: key => latestT.current(key) }), dependencies: [
|
|
12
|
+
const { controller, snapshot } = useController({ create: () => createWidgetRegionEditorController({ api: cachedApi, regionKey: keyRef.current }, { t: key => latestT.current(key) }), dependencies: [cachedApi] }, { start: ({ controller }) => { void controller.load(); } });
|
|
11
13
|
useEffect(() => { if (keyRef.current !== regionKey) {
|
|
12
14
|
keyRef.current = regionKey;
|
|
13
15
|
controller?.setRegionKey({ regionKey });
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useInvalidate } from '@jini-ai/ui/fetch-query';
|
|
2
|
+
import { WIDGET_QUERY_KEYS, useWidgetRegionsQuery } from './WidgetsQuery.hooks.js';
|
|
1
3
|
import { useEffect, useRef } from 'react';
|
|
2
4
|
import { useController } from '../../../core/react/use-controller.js';
|
|
3
5
|
import { createWidgetRegionsController } from '../../controllers/regions.controller.js';
|
|
@@ -5,12 +7,14 @@ import { widgetsEnglish } from '../../messages.en.js';
|
|
|
5
7
|
import { WIDGETS_REGIONS_RESOURCE } from '../../rules.js';
|
|
6
8
|
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
7
9
|
export function useWidgetRegions({ api }, { t = widgetsEnglish, locale = 'en', events, navigate } = {}) {
|
|
10
|
+
const cached = useWidgetRegionsQuery({ api });
|
|
11
|
+
const invalidate = useInvalidate();
|
|
8
12
|
const latest = useRef({ t, navigate });
|
|
9
13
|
latest.current = { t, navigate };
|
|
10
|
-
const { controller, snapshot } = useController({ create: () => createWidgetRegionsController({ api }, { t: key => latest.current.t(key), navigate: path => latest.current.navigate?.(path) }), dependencies: [api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
14
|
+
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(); } });
|
|
11
15
|
useEffect(() => { if (!controller)
|
|
12
|
-
return; return events?.subscribe({ resource: WIDGETS_REGIONS_RESOURCE, onRefresh: () => {
|
|
13
|
-
return { ...(snapshot ?? { regions: null, error: null, newRegionKey: '', binding: false }), setNewRegionKey: value => controller?.setNewRegionKey({ value }), bind: async () => { await controller?.bind(); }, t };
|
|
16
|
+
return; return events?.subscribe({ resource: WIDGETS_REGIONS_RESOURCE, onRefresh: () => invalidate({ key: WIDGET_QUERY_KEYS.regions }) }); }, [controller, events, invalidate]);
|
|
17
|
+
return { ...(snapshot ?? { regions: null, error: null, newRegionKey: '', binding: false }), regions: cached.query.data?.regions ?? snapshot?.regions ?? null, error: snapshot?.error ?? cached.query.error?.message ?? null, setNewRegionKey: value => controller?.setNewRegionKey({ value }), bind: async () => { await controller?.bind(); }, t };
|
|
14
18
|
}
|
|
15
19
|
export function useWiredWidgetRegions() {
|
|
16
20
|
const { widgetsApi: api, widgetsEvents: events, widgetsNavigation } = useWidgetsPorts();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useInvalidate } from '@jini-ai/ui/fetch-query';
|
|
2
|
+
import { WIDGET_QUERY_KEYS, useWidgetsListQuery } from './WidgetsQuery.hooks.js';
|
|
1
3
|
import { useEffect, useRef } from 'react';
|
|
2
4
|
import { useController } from '../../../core/react/use-controller.js';
|
|
3
5
|
import { createWidgetsLibraryController } from '../../controllers/library.controller.js';
|
|
@@ -5,13 +7,15 @@ import { widgetsEnglish } from '../../messages.en.js';
|
|
|
5
7
|
import { WIDGETS_LIBRARY_RESOURCE } from '../../rules.js';
|
|
6
8
|
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
7
9
|
export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en', events } = {}) {
|
|
10
|
+
const cached = useWidgetsListQuery({ api });
|
|
11
|
+
const invalidate = useInvalidate();
|
|
8
12
|
const latestT = useRef(t);
|
|
9
13
|
latestT.current = t;
|
|
10
|
-
const { controller, snapshot } = useController({ create: () => createWidgetsLibraryController({ api }, { t: key => latestT.current(key) }), dependencies: [api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
14
|
+
const { controller, snapshot } = useController({ create: () => createWidgetsLibraryController({ api: cached.api }, { t: key => latestT.current(key) }), dependencies: [cached.api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
11
15
|
useEffect(() => { if (!controller)
|
|
12
|
-
return; return events?.subscribe({ resource: WIDGETS_LIBRARY_RESOURCE, onRefresh: () => {
|
|
16
|
+
return; return events?.subscribe({ resource: WIDGETS_LIBRARY_RESOURCE, onRefresh: () => invalidate({ key: WIDGET_QUERY_KEYS.library }) }); }, [controller, events, invalidate]);
|
|
13
17
|
const state = snapshot ?? { widgets: null, error: null, skippedCount: 0, skippedIds: [], createType: 'text', pendingTrash: null, trashingId: null };
|
|
14
|
-
return { ...state, trashing: state.pendingTrash !== null && state.trashingId === state.pendingTrash.id,
|
|
18
|
+
return { ...state, widgets: cached.query.data?.widgets ?? state.widgets, skippedCount: cached.query.data?.skippedCount ?? state.skippedCount, skippedIds: cached.query.data?.skippedIds ?? state.skippedIds, error: state.error ?? cached.query.error?.message ?? null, trashing: state.pendingTrash !== null && state.trashingId === state.pendingTrash.id,
|
|
15
19
|
setCreateType: type => controller?.setCreateType({ type }), requestTrash: widget => controller?.requestTrash({ widget }),
|
|
16
20
|
confirmTrash: async () => { await controller?.confirmTrash(); }, cancelTrash: () => controller?.cancelTrash(), t, locale };
|
|
17
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/admin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
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": {
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"./widgets/react": "browser",
|
|
76
76
|
"./widgets/adapters/http": "universal",
|
|
77
77
|
"./widgets/adapters/memory": "universal",
|
|
78
|
-
"./widgets/conformance": "universal"
|
|
78
|
+
"./widgets/conformance": "universal",
|
|
79
|
+
"./consent/react": "browser"
|
|
79
80
|
},
|
|
80
81
|
"isolation": {
|
|
81
82
|
"forbidden": {
|
|
@@ -406,6 +407,11 @@
|
|
|
406
407
|
"types": "./dist/widgets/conformance/widgets-api.conformance.d.ts",
|
|
407
408
|
"import": "./dist/widgets/conformance/widgets-api.conformance.js",
|
|
408
409
|
"default": "./dist/widgets/conformance/widgets-api.conformance.js"
|
|
410
|
+
},
|
|
411
|
+
"./consent/react": {
|
|
412
|
+
"types": "./dist/consent/react/index.d.ts",
|
|
413
|
+
"import": "./dist/consent/react/index.js",
|
|
414
|
+
"default": "./dist/consent/react/index.js"
|
|
409
415
|
}
|
|
410
416
|
},
|
|
411
417
|
"files": [
|
|
@@ -427,12 +433,12 @@
|
|
|
427
433
|
"peerDependencies": {
|
|
428
434
|
"react": "^18.3.0 || ^19.0.0",
|
|
429
435
|
"react-dom": "^18.3.0 || ^19.0.0",
|
|
430
|
-
"@jini-ai/agentic": "^0.4.
|
|
431
|
-
"@jini-ai/ui": "^0.4.
|
|
432
|
-
"@jini-ai/ui-kit": "^0.1.
|
|
433
|
-
"@jini-ai/agent-plugins": "^0.4.
|
|
434
|
-
"@jini-ai/cms": "^0.5.
|
|
435
|
-
"@jini-ai/core": "^0.4.
|
|
436
|
+
"@jini-ai/agentic": "^0.4.4",
|
|
437
|
+
"@jini-ai/ui": "^0.4.8",
|
|
438
|
+
"@jini-ai/ui-kit": "^0.1.3",
|
|
439
|
+
"@jini-ai/agent-plugins": "^0.4.3",
|
|
440
|
+
"@jini-ai/cms": "^0.5.6",
|
|
441
|
+
"@jini-ai/core": "^0.4.3"
|
|
436
442
|
},
|
|
437
443
|
"peerDependenciesMeta": {
|
|
438
444
|
"react": {
|
|
@@ -470,12 +476,12 @@
|
|
|
470
476
|
"react": "^19.2.0",
|
|
471
477
|
"react-dom": "^19.2.0",
|
|
472
478
|
"@testing-library/user-event": "^14.6.1",
|
|
473
|
-
"@jini-ai/agentic": "^0.4.
|
|
474
|
-
"@jini-ai/
|
|
475
|
-
"@jini-ai/
|
|
476
|
-
"@jini-ai/core": "^0.4.
|
|
477
|
-
"@jini-ai/
|
|
478
|
-
"@jini-ai/
|
|
479
|
+
"@jini-ai/agentic": "^0.4.4",
|
|
480
|
+
"@jini-ai/cms": "^0.5.6",
|
|
481
|
+
"@jini-ai/agent-plugins": "^0.4.3",
|
|
482
|
+
"@jini-ai/core": "^0.4.3",
|
|
483
|
+
"@jini-ai/ui": "^0.4.8",
|
|
484
|
+
"@jini-ai/ui-kit": "^0.1.3"
|
|
479
485
|
},
|
|
480
486
|
"typesVersions": {
|
|
481
487
|
"*": {
|