@asteby/metacore-runtime-react 53.25.0 → 53.26.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.
- package/CHANGELOG.md +11 -0
- package/dist/action-modal-dispatcher.d.ts +3 -3
- package/dist/action-modal-dispatcher.js +31 -31
- package/dist/action-priority.d.ts +1 -1
- package/dist/activity-diff.d.ts +1 -1
- package/dist/activity-diff.js +1 -1
- package/dist/activity-timeline.d.ts +2 -2
- package/dist/activity-timeline.js +3 -3
- package/dist/activity-value-renderer.d.ts +1 -1
- package/dist/activity-value-renderer.js +3 -3
- package/dist/addon-loader.d.ts +1 -1
- package/dist/addon-loader.js +3 -3
- package/dist/addon-page-host.js +1 -1
- package/dist/addon-page-loader.d.ts +2 -2
- package/dist/addon-page-loader.js +3 -3
- package/dist/api-context.js +4 -4
- package/dist/approval-gate.d.ts +1 -1
- package/dist/approval-gate.js +5 -5
- package/dist/assist-interview.d.ts +1 -1
- package/dist/assist-interview.js +1 -1
- package/dist/attention/index.d.ts +3 -3
- package/dist/attention/index.js +3 -3
- package/dist/attention/use-nav-badges.js +2 -2
- package/dist/attribute-classes.d.ts +1 -1
- package/dist/audit-info.d.ts +1 -1
- package/dist/audit-info.js +5 -5
- package/dist/bulk-image-dialog.d.ts +1 -1
- package/dist/bulk-image-dialog.js +5 -5
- package/dist/bulk-image-import.d.ts +2 -2
- package/dist/bulk-image-import.js +1 -1
- package/dist/bulk-image-target.d.ts +1 -1
- package/dist/bulk-image-target.js +1 -1
- package/dist/bulk-image-wizard.d.ts +1 -1
- package/dist/bulk-image-wizard.js +5 -5
- package/dist/business/catalog-product-search.d.ts +1 -1
- package/dist/business/customer-picker.js +4 -4
- package/dist/business/document-editor-model.d.ts +3 -3
- package/dist/business/document-editor-model.js +4 -4
- package/dist/business/document-editor-panels.d.ts +3 -3
- package/dist/business/document-editor-panels.js +1 -1
- package/dist/business/document-editor.d.ts +2 -2
- package/dist/business/document-editor.js +22 -22
- package/dist/business/document-lines.d.ts +2 -2
- package/dist/business/document-lines.js +3 -3
- package/dist/business/field-errors.d.ts +1 -1
- package/dist/business/field-errors.js +1 -1
- package/dist/business/format.js +1 -1
- package/dist/business/index.d.ts +29 -29
- package/dist/business/index.js +29 -29
- package/dist/business/inspection-checklist.d.ts +1 -1
- package/dist/business/inspection-checklist.js +2 -2
- package/dist/business/inspection.d.ts +1 -1
- package/dist/business/inspection.js +2 -2
- package/dist/business/line-items-editor.d.ts +3 -3
- package/dist/business/line-items-editor.js +5 -5
- package/dist/business/line-items.d.ts +1 -1
- package/dist/business/line-items.js +2 -2
- package/dist/business/line-product-cell.d.ts +2 -2
- package/dist/business/line-product-cell.js +2 -2
- package/dist/business/payment-allocator.d.ts +1 -1
- package/dist/business/payment-allocator.js +2 -2
- package/dist/business/payment-capture.d.ts +1 -1
- package/dist/business/payment-capture.js +3 -3
- package/dist/business/payment.js +1 -1
- package/dist/business/print-send-dialog.js +1 -1
- package/dist/business/product-display.d.ts +1 -1
- package/dist/business/product-options.d.ts +1 -1
- package/dist/business/product-options.js +4 -4
- package/dist/business/product-picker.d.ts +1 -1
- package/dist/business/product-picker.js +3 -3
- package/dist/business/product-search.d.ts +2 -2
- package/dist/business/product-search.js +1 -1
- package/dist/business/refund-destination.d.ts +1 -1
- package/dist/business/refund-destination.js +2 -2
- package/dist/business/refund.js +1 -1
- package/dist/business/relate-documents.js +1 -1
- package/dist/business/return-wizard.d.ts +2 -2
- package/dist/business/return-wizard.js +4 -4
- package/dist/business/return.d.ts +2 -2
- package/dist/business/return.js +2 -2
- package/dist/business/vehicle-picker.js +3 -3
- package/dist/cache-coherence.js +3 -3
- package/dist/capability-providers/index.d.ts +3 -3
- package/dist/capability-providers/index.js +3 -3
- package/dist/capability-providers/provider-sortable-list.d.ts +1 -1
- package/dist/capability-providers/provider-sortable-list.js +1 -1
- package/dist/collection-cell.js +1 -1
- package/dist/column-filter-field.d.ts +1 -1
- package/dist/column-visibility.d.ts +1 -1
- package/dist/custom-stages.d.ts +2 -2
- package/dist/custom-stages.js +1 -1
- package/dist/dashboard-grid.d.ts +1 -1
- package/dist/dashboard-grid.js +3 -3
- package/dist/dialogs/create-record-dialog.d.ts +1 -1
- package/dist/dialogs/create-record-dialog.js +1 -1
- package/dist/dialogs/dynamic-record.d.ts +5 -5
- package/dist/dialogs/dynamic-record.js +41 -41
- package/dist/dialogs/export.d.ts +1 -1
- package/dist/dialogs/export.js +2 -2
- package/dist/dialogs/import.d.ts +1 -1
- package/dist/dialogs/import.js +3 -3
- package/dist/dialogs/inline-relation-rows.d.ts +3 -3
- package/dist/dialogs/inline-relation-rows.js +3 -3
- package/dist/dialogs/inline-relations.d.ts +3 -3
- package/dist/dialogs/inline-relations.js +3 -3
- package/dist/dialogs/normalize-submit.d.ts +1 -1
- package/dist/dialogs/normalize-submit.js +3 -3
- package/dist/dialogs/use-inline-relations.d.ts +1 -1
- package/dist/dialogs/use-inline-relations.js +3 -3
- package/dist/dialogs/view-record-dialog.d.ts +1 -1
- package/dist/dialogs/view-record-dialog.js +1 -1
- package/dist/display-value.js +1 -1
- package/dist/document/action-bar.d.ts +1 -1
- package/dist/document/action-bar.js +1 -1
- package/dist/document/document-header.d.ts +2 -2
- package/dist/document/document-header.js +2 -2
- package/dist/document/document-page.d.ts +3 -3
- package/dist/document/document-page.js +9 -9
- package/dist/document/document-timeline.d.ts +2 -2
- package/dist/document/document-timeline.js +2 -2
- package/dist/document/evaluate.d.ts +1 -1
- package/dist/document/evaluate.js +1 -1
- package/dist/document/format.d.ts +1 -1
- package/dist/document/index.d.ts +13 -13
- package/dist/document/index.js +13 -13
- package/dist/document/registry.d.ts +1 -1
- package/dist/document/secondary-bar.js +2 -2
- package/dist/document/smart-buttons.js +1 -1
- package/dist/document/status-badge.d.ts +1 -1
- package/dist/document/use-document-sources.d.ts +1 -1
- package/dist/document/use-document-sources.js +2 -2
- package/dist/document-form-dialog.d.ts +2 -2
- package/dist/document-form-dialog.js +16 -16
- package/dist/document-template-editor.js +1 -1
- package/dist/dynamic-columns-shim.d.ts +1 -1
- package/dist/dynamic-columns.d.ts +3 -3
- package/dist/dynamic-columns.js +19 -19
- package/dist/dynamic-crud-page.d.ts +2 -2
- package/dist/dynamic-crud-page.js +13 -13
- package/dist/dynamic-date-field.d.ts +1 -1
- package/dist/dynamic-date-field.js +1 -1
- package/dist/dynamic-form-schema.d.ts +2 -2
- package/dist/dynamic-form-schema.js +4 -4
- package/dist/dynamic-form.d.ts +10 -10
- package/dist/dynamic-form.js +24 -24
- package/dist/dynamic-icon.js +1 -1
- package/dist/dynamic-kanban.d.ts +3 -3
- package/dist/dynamic-kanban.js +25 -25
- package/dist/dynamic-line-items.d.ts +1 -1
- package/dist/dynamic-line-items.js +6 -6
- package/dist/dynamic-multi-select-field.d.ts +1 -1
- package/dist/dynamic-multi-select-field.js +7 -7
- package/dist/dynamic-relation-helpers.d.ts +1 -1
- package/dist/dynamic-relation-helpers.js +2 -2
- package/dist/dynamic-relation.d.ts +2 -2
- package/dist/dynamic-relation.js +15 -15
- package/dist/dynamic-relations.d.ts +2 -2
- package/dist/dynamic-relations.js +1 -1
- package/dist/dynamic-row-actions.d.ts +1 -1
- package/dist/dynamic-row-actions.js +5 -5
- package/dist/dynamic-select-field.d.ts +3 -3
- package/dist/dynamic-select-field.js +11 -11
- package/dist/dynamic-table.d.ts +2 -2
- package/dist/dynamic-table.js +24 -24
- package/dist/dynamic-view.d.ts +4 -4
- package/dist/dynamic-view.js +7 -7
- package/dist/entity-select.js +4 -4
- package/dist/field-validation-ui.d.ts +2 -2
- package/dist/field-widget-registry.d.ts +1 -1
- package/dist/form-layout-ui.d.ts +1 -1
- package/dist/form-layout.d.ts +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/genui/index.d.ts +1 -1
- package/dist/genui/index.js +1 -1
- package/dist/genui/settings-block.d.ts +1 -1
- package/dist/genui/settings-block.js +3 -3
- package/dist/host-api-client.d.ts +11 -1
- package/dist/host-api-client.d.ts.map +1 -1
- package/dist/host-api-client.js +21 -14
- package/dist/host-api.d.ts +9 -1
- package/dist/host-api.d.ts.map +1 -1
- package/dist/host-api.js +57 -2
- package/dist/hotswap-reload-policy.d.ts +1 -1
- package/dist/hotswap-reload-policy.js +1 -1
- package/dist/icon-picker-field.d.ts +1 -1
- package/dist/icon-picker-field.js +3 -3
- package/dist/icon-resolvers.d.ts +1 -1
- package/dist/icon-resolvers.js +1 -1
- package/dist/icon-spec.js +1 -1
- package/dist/index.d.ts +165 -165
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -148
- package/dist/license/index.d.ts +6 -6
- package/dist/license/index.js +6 -6
- package/dist/license/license-expiry-banner.d.ts +1 -1
- package/dist/license/license-expiry-banner.js +3 -3
- package/dist/license/license-gate.d.ts +1 -1
- package/dist/license/license-gate.js +5 -5
- package/dist/license/license-status-badge.d.ts +1 -1
- package/dist/license/license-status-badge.js +1 -1
- package/dist/license/use-license-t.d.ts +1 -1
- package/dist/license/use-license-t.js +1 -1
- package/dist/license/view.d.ts +1 -1
- package/dist/license/view.js +1 -1
- package/dist/list-include.d.ts +1 -1
- package/dist/manifest-hotswap-subscriber.d.ts +1 -1
- package/dist/manifest-hotswap-subscriber.js +1 -1
- package/dist/metadata-cache.d.ts +1 -1
- package/dist/metadata-cache.js +1 -1
- package/dist/model-action-toolbar.d.ts +1 -1
- package/dist/model-action-toolbar.js +7 -7
- package/dist/nav-permissions.d.ts +1 -1
- package/dist/nav-permissions.js +1 -1
- package/dist/navigation-builder.d.ts +1 -1
- package/dist/navigation-builder.js +1 -1
- package/dist/option-display.d.ts +1 -1
- package/dist/option-display.js +2 -2
- package/dist/option-filter.d.ts +1 -1
- package/dist/option-when.d.ts +1 -1
- package/dist/org-runtime-provider.d.ts +2 -2
- package/dist/org-runtime-provider.js +2 -2
- package/dist/permissions-context.d.ts +1 -1
- package/dist/permissions-manager.js +4 -4
- package/dist/primitives/aging.js +1 -1
- package/dist/primitives/allocation.js +1 -1
- package/dist/primitives/approvals.d.ts +1 -1
- package/dist/primitives/contributions.js +1 -1
- package/dist/primitives/document-kinds.d.ts +1 -1
- package/dist/primitives/index.d.ts +7 -7
- package/dist/primitives/index.js +7 -7
- package/dist/primitives/panels.d.ts +1 -1
- package/dist/primitives/use-contributions.d.ts +2 -2
- package/dist/primitives/use-contributions.js +2 -2
- package/dist/print-document-button.d.ts +1 -1
- package/dist/print-document-button.js +1 -1
- package/dist/provenance.js +3 -3
- package/dist/query-batch.d.ts +1 -1
- package/dist/query-batch.js +1 -1
- package/dist/record-actions.d.ts +2 -2
- package/dist/record-actions.js +2 -2
- package/dist/record-history.d.ts +2 -2
- package/dist/record-history.js +3 -3
- package/dist/record-picker-dialog.js +3 -3
- package/dist/record-picker-option.d.ts +1 -1
- package/dist/record-picker-option.js +1 -1
- package/dist/record-picker.js +2 -2
- package/dist/record-prefill-bar.js +1 -1
- package/dist/relation-gallery.js +1 -1
- package/dist/requires-addon.d.ts +1 -1
- package/dist/rich-cells.js +2 -2
- package/dist/rich-url.js +1 -1
- package/dist/row-actions-menu.js +5 -5
- package/dist/server-error.js +2 -2
- package/dist/setup/addon-config-surface.d.ts +3 -3
- package/dist/setup/addon-config-surface.js +10 -10
- package/dist/setup/connector-blocks-model.d.ts +1 -1
- package/dist/setup/connector-blocks.d.ts +1 -1
- package/dist/setup/connector-blocks.js +6 -6
- package/dist/setup/flow-model.d.ts +1 -1
- package/dist/setup/health-card.d.ts +1 -1
- package/dist/setup/health-card.js +2 -2
- package/dist/setup/index.d.ts +12 -12
- package/dist/setup/index.js +12 -12
- package/dist/setup/records-table.d.ts +1 -1
- package/dist/setup/records-table.js +2 -2
- package/dist/setup/setup-flow.d.ts +1 -1
- package/dist/setup/setup-flow.js +7 -7
- package/dist/setup/setup-form-step.d.ts +1 -1
- package/dist/setup/setup-form-step.js +4 -4
- package/dist/setup/step-status-badge.d.ts +1 -1
- package/dist/setup/step-status-badge.js +2 -2
- package/dist/setup/tone.d.ts +1 -1
- package/dist/setup/types.d.ts +2 -2
- package/dist/sidebar-layout-manager.d.ts +1 -1
- package/dist/sidebar-layout-manager.js +2 -2
- package/dist/slot.js +1 -1
- package/dist/slots/addon-slot.js +4 -4
- package/dist/slots/index.d.ts +2 -2
- package/dist/slots/index.js +2 -2
- package/dist/stage-automations.d.ts +2 -2
- package/dist/stage-automations.js +1 -1
- package/dist/stage-layout.js +1 -1
- package/dist/stage-overrides.d.ts +1 -1
- package/dist/stage-overrides.js +1 -1
- package/dist/supervised-action.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/tri-state-boolean.d.ts +2 -2
- package/dist/tri-state-boolean.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/upload-field.d.ts +1 -1
- package/dist/upload-field.js +4 -4
- package/dist/use-addon-installed-probe.js +3 -3
- package/dist/use-addon-settings.d.ts +1 -1
- package/dist/use-addon-settings.js +1 -1
- package/dist/use-dynamic-filters.d.ts +2 -2
- package/dist/use-dynamic-filters.js +6 -6
- package/dist/use-edge-device.d.ts +1 -1
- package/dist/use-edge-device.js +2 -2
- package/dist/use-facet-loaders.d.ts +1 -1
- package/dist/use-facet-loaders.js +1 -1
- package/dist/use-flip-animation.d.ts +1 -1
- package/dist/use-flip-animation.js +1 -1
- package/dist/use-host-api-client.d.ts +2 -2
- package/dist/use-host-api-client.d.ts.map +1 -1
- package/dist/use-host-api-client.js +6 -4
- package/dist/use-option-ids.d.ts +1 -1
- package/dist/use-option-ids.js +2 -2
- package/dist/use-options-resolver.d.ts +2 -2
- package/dist/use-options-resolver.js +4 -4
- package/dist/use-org-document-templates.js +1 -1
- package/dist/use-print-document.js +1 -1
- package/dist/use-record-mutation-tick.js +1 -1
- package/dist/validator.d.ts +2 -2
- package/dist/validator.js +1 -1
- package/dist/view-system/card-spec.d.ts +1 -1
- package/dist/view-system/cards-view.d.ts +1 -1
- package/dist/view-system/cards-view.js +2 -2
- package/dist/view-system/index.d.ts +9 -9
- package/dist/view-system/index.js +9 -9
- package/dist/view-system/model-view.d.ts +3 -3
- package/dist/view-system/model-view.js +7 -7
- package/dist/view-system/saved-views.d.ts +1 -1
- package/dist/view-system/use-view-mode.d.ts +1 -1
- package/dist/view-system/view-state.d.ts +1 -1
- package/dist/view-system/view-switcher.d.ts +1 -1
- package/dist/view-system/view-toolbar.d.ts +1 -1
- package/dist/view-system/view-toolbar.js +2 -2
- package/dist/views/calendar-view.d.ts +1 -1
- package/dist/views/calendar-view.js +2 -2
- package/dist/views/chart-view.d.ts +2 -2
- package/dist/views/chart-view.js +2 -2
- package/dist/views/data-source.d.ts +2 -2
- package/dist/views/index.d.ts +3 -3
- package/dist/views/index.js +2 -2
- package/dist/views/map-view.d.ts +1 -1
- package/dist/views/map-view.js +3 -3
- package/dist/views/panels.d.ts +1 -1
- package/dist/views/panels.js +3 -3
- package/dist/views/registry.d.ts +2 -2
- package/dist/views/registry.js +12 -12
- package/dist/views/split-view.d.ts +1 -1
- package/dist/views/split-view.js +4 -4
- package/dist/views/timeline-view.d.ts +1 -1
- package/dist/views/timeline-view.js +3 -3
- package/dist/views/types.d.ts +2 -2
- package/dist/widgets/charts.d.ts +1 -1
- package/dist/widgets/charts.js +2 -2
- package/dist/widgets/lazy-charts.d.ts +1 -1
- package/dist/widgets/lazy-charts.js +2 -2
- package/dist/widgets/renderers.d.ts +2 -2
- package/dist/widgets/renderers.js +2 -2
- package/dist/widgets/widget-card.d.ts +1 -1
- package/dist/widgets/widget-card.js +2 -2
- package/dist/widgets/widget-renderer.d.ts +1 -1
- package/dist/widgets/widget-renderer.js +4 -4
- package/package.json +9 -9
- package/src/__tests__/host-api-client.test.tsx +16 -0
- package/src/__tests__/host-api.test.ts +50 -0
- package/src/host-api-client.ts +31 -14
- package/src/host-api.ts +54 -1
- package/src/index.ts +2 -1
- package/src/use-host-api-client.ts +5 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RunStepInput, SetupFlowClient, SetupFlowDef, SetupFlowState, SetupStepDef, SetupStepState } from './types';
|
|
1
|
+
import type { RunStepInput, SetupFlowClient, SetupFlowDef, SetupFlowState, SetupStepDef, SetupStepState } from './types.js';
|
|
2
2
|
export interface SetupCustomStepProps {
|
|
3
3
|
step: SetupStepDef;
|
|
4
4
|
state?: SetupStepState;
|
package/dist/setup/setup-flow.js
CHANGED
|
@@ -3,13 +3,13 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { Loader2, RefreshCw } from 'lucide-react';
|
|
4
4
|
import { Button } from '@asteby/metacore-ui/primitives';
|
|
5
5
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
6
|
-
import { Slot } from '../slot';
|
|
7
|
-
import { useSetupT } from './messages';
|
|
8
|
-
import { effectiveStatus, flowProgress, isSatisfied, mergeAnswer, nextPollDelayMs, normalizeState, pickActiveStep, safeUrl, unmetDependencies, } from './flow-model';
|
|
9
|
-
import { RecordsTable } from './records-table';
|
|
10
|
-
import { SetupFormStep } from './setup-form-step';
|
|
11
|
-
import { StepStatusBadge } from './step-status-badge';
|
|
12
|
-
import { TONE_TEXT } from './tone';
|
|
6
|
+
import { Slot } from '../slot.js';
|
|
7
|
+
import { useSetupT } from './messages.js';
|
|
8
|
+
import { effectiveStatus, flowProgress, isSatisfied, mergeAnswer, nextPollDelayMs, normalizeState, pickActiveStep, safeUrl, unmetDependencies, } from './flow-model.js';
|
|
9
|
+
import { RecordsTable } from './records-table.js';
|
|
10
|
+
import { SetupFormStep } from './setup-form-step.js';
|
|
11
|
+
import { StepStatusBadge } from './step-status-badge.js';
|
|
12
|
+
import { TONE_TEXT } from './tone.js';
|
|
13
13
|
const errorMessage = (e, fallback) => {
|
|
14
14
|
const r = e?.response?.data?.message;
|
|
15
15
|
if (typeof r === 'string' && r.trim())
|
|
@@ -3,10 +3,10 @@ import { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react'
|
|
|
3
3
|
import { Loader2 } from 'lucide-react';
|
|
4
4
|
import { Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Switch, Textarea, } from '@asteby/metacore-ui/primitives';
|
|
5
5
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
6
|
-
import { evaluateVisibleWhen, getVisibleWhen } from '../dynamic-form-schema';
|
|
7
|
-
import { groupFieldsBySection } from '../form-layout';
|
|
8
|
-
import { FieldSection, WizardProgress } from '../form-layout-ui';
|
|
9
|
-
import { useSetupT } from './messages';
|
|
6
|
+
import { evaluateVisibleWhen, getVisibleWhen } from '../dynamic-form-schema.js';
|
|
7
|
+
import { groupFieldsBySection } from '../form-layout.js';
|
|
8
|
+
import { FieldSection, WizardProgress } from '../form-layout-ui.js';
|
|
9
|
+
import { useSetupT } from './messages.js';
|
|
10
10
|
const AUTOSAVE_MS = 800;
|
|
11
11
|
function initialValues(fields, saved) {
|
|
12
12
|
const out = {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AlertTriangle, Circle, CheckCircle2, Loader2, Lock, XCircle } from 'lucide-react';
|
|
3
3
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
4
|
-
import { useSetupT } from './messages';
|
|
5
|
-
import { STEP_TONE, TONE_BADGE } from './tone';
|
|
4
|
+
import { useSetupT } from './messages.js';
|
|
5
|
+
import { STEP_TONE, TONE_BADGE } from './tone.js';
|
|
6
6
|
const ICONS = {
|
|
7
7
|
pending: Circle,
|
|
8
8
|
running: Loader2,
|
package/dist/setup/tone.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MetricTone, RecordStatus, StepStatus } from './types';
|
|
1
|
+
import type { MetricTone, RecordStatus, StepStatus } from './types.js';
|
|
2
2
|
export type Tone = 'neutral' | 'info' | 'good' | 'warn' | 'bad';
|
|
3
3
|
export declare const TONE_BADGE: Record<Tone, string>;
|
|
4
4
|
export declare const TONE_TEXT: Record<Tone, string>;
|
package/dist/setup/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FormLayout } from '../form-layout';
|
|
2
|
-
import type { VisibleWhen } from '../types';
|
|
1
|
+
import type { FormLayout } from '../form-layout.js';
|
|
2
|
+
import type { VisibleWhen } from '../types.js';
|
|
3
3
|
export type StepStatus = 'pending' | 'running' | 'ok' | 'warn' | 'error' | 'blocked';
|
|
4
4
|
export type SetupStepKind = 'check' | 'form' | 'action' | 'records' | 'custom';
|
|
5
5
|
/** What the "fix" button of a diagnostic does. Exactly one is expected. */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The canvas IS the sidebar: sections, folders, leaves — drag, rename, nest.
|
|
4
4
|
*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { type CatalogLeaf, type SidebarLayoutDoc, type SidebarLayoutNode } from './apply-sidebar-layout';
|
|
6
|
+
import { type CatalogLeaf, type SidebarLayoutDoc, type SidebarLayoutNode } from './apply-sidebar-layout.js';
|
|
7
7
|
export interface SidebarLayoutManagerProps {
|
|
8
8
|
loadLayout: () => Promise<SidebarLayoutDoc>;
|
|
9
9
|
saveLayout: (doc: SidebarLayoutDoc) => Promise<void>;
|
|
@@ -7,12 +7,12 @@ import * as React from 'react';
|
|
|
7
7
|
import { DndContext, PointerSensor, closestCenter, useSensor, useSensors, } from '@dnd-kit/core';
|
|
8
8
|
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy, } from '@dnd-kit/sortable';
|
|
9
9
|
import { CSS } from '@dnd-kit/utilities';
|
|
10
|
-
import { PortalDragOverlay } from './portal-drag-overlay';
|
|
10
|
+
import { PortalDragOverlay } from './portal-drag-overlay.js';
|
|
11
11
|
import { ChevronDown, ChevronRight, FolderPlus, GripVertical, Pencil, Plus, RotateCcw, Save, Trash2, Eye, EyeOff, Hash, Folder, } from 'lucide-react';
|
|
12
12
|
import { toast } from 'sonner';
|
|
13
13
|
import { Button, Input, ScrollArea, } from '@asteby/metacore-ui/primitives';
|
|
14
14
|
import { cn } from '@asteby/metacore-ui/lib';
|
|
15
|
-
import { collectFolderKeys, folderAccessCapability, layoutTreeFromNavGroups, leafRefFor, slugifyFolderKey, } from './apply-sidebar-layout';
|
|
15
|
+
import { collectFolderKeys, folderAccessCapability, layoutTreeFromNavGroups, leafRefFor, slugifyFolderKey, } from './apply-sidebar-layout.js';
|
|
16
16
|
function pathKey(path) {
|
|
17
17
|
return path.length ? path.join('.') : 'root';
|
|
18
18
|
}
|
package/dist/slot.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
// consta como NO instalado (InstalledAddonsProvider) no se pinta.
|
|
10
10
|
import { useSyncExternalStore } from 'react';
|
|
11
11
|
import { slotStore } from '@asteby/metacore-sdk';
|
|
12
|
-
import { useInstalledAddons } from './installed-addons-context';
|
|
12
|
+
import { useInstalledAddons } from './installed-addons-context.js';
|
|
13
13
|
/** Alias histórico del store canónico (`slotRegistry.register/get/subscribe`). */
|
|
14
14
|
export const slotRegistry = slotStore;
|
|
15
15
|
export function Slot({ name, props, fallback = null }) {
|
package/dist/slots/addon-slot.js
CHANGED
|
@@ -22,10 +22,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
22
22
|
// en proceso (equivale al `<Slot>` histórico).
|
|
23
23
|
import { createContext, Suspense, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
24
24
|
import { slotStore } from '@asteby/metacore-sdk';
|
|
25
|
-
import { loadFederatedModule } from '../addon-loader';
|
|
26
|
-
import { FederatedErrorBoundary } from '../federated-error-boundary';
|
|
27
|
-
import { useInstalledAddons } from '../installed-addons-context';
|
|
28
|
-
import { satisfiesSdkRange } from './sdk-range';
|
|
25
|
+
import { loadFederatedModule } from '../addon-loader.js';
|
|
26
|
+
import { FederatedErrorBoundary } from '../federated-error-boundary.js';
|
|
27
|
+
import { useInstalledAddons } from '../installed-addons-context.js';
|
|
28
|
+
import { satisfiesSdkRange } from './sdk-range.js';
|
|
29
29
|
export const ADDON_SLOT_FAILED = 'addon_slot_failed';
|
|
30
30
|
export const DEFAULT_ADDON_SLOT_TIMEOUT_MS = 10_000;
|
|
31
31
|
/** Rango permitido por el contrato C1 para `slot.timeout_ms` del manifest. */
|
package/dist/slots/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AddonSlot, AddonSlotProvider, sortSlotItems, ADDON_SLOT_FAILED, DEFAULT_ADDON_SLOT_TIMEOUT_MS, resolveSlotTimeout, type AddonSlotProps, type AddonSlotProviderProps, type AddonSlotManifest, type AddonSlotContribution, type AddonSlotSDK, type AddonSlotComponentProps, type AddonSlotFailure, type AddonSlotFailureReason, type AddonSlotEventHandler, } from './addon-slot';
|
|
2
|
-
export { satisfiesSdkRange } from './sdk-range';
|
|
1
|
+
export { AddonSlot, AddonSlotProvider, sortSlotItems, ADDON_SLOT_FAILED, DEFAULT_ADDON_SLOT_TIMEOUT_MS, resolveSlotTimeout, type AddonSlotProps, type AddonSlotProviderProps, type AddonSlotManifest, type AddonSlotContribution, type AddonSlotSDK, type AddonSlotComponentProps, type AddonSlotFailure, type AddonSlotFailureReason, type AddonSlotEventHandler, } from './addon-slot.js';
|
|
2
|
+
export { satisfiesSdkRange } from './sdk-range.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/slots/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AddonSlot, AddonSlotProvider, sortSlotItems, ADDON_SLOT_FAILED, DEFAULT_ADDON_SLOT_TIMEOUT_MS, resolveSlotTimeout, } from './addon-slot';
|
|
2
|
-
export { satisfiesSdkRange } from './sdk-range';
|
|
1
|
+
export { AddonSlot, AddonSlotProvider, sortSlotItems, ADDON_SLOT_FAILED, DEFAULT_ADDON_SLOT_TIMEOUT_MS, resolveSlotTimeout, } from './addon-slot.js';
|
|
2
|
+
export { satisfiesSdkRange } from './sdk-range.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ApiClient } from './api-context';
|
|
3
|
-
import type { ColumnDefinition } from './types';
|
|
2
|
+
import type { ApiClient } from './api-context.js';
|
|
3
|
+
import type { ColumnDefinition } from './types.js';
|
|
4
4
|
export type StageAutomationActionType = 'add_tag' | 'remove_tag' | 'set_field';
|
|
5
5
|
export interface StageAutomationAction {
|
|
6
6
|
type: StageAutomationActionType;
|
|
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { Zap, Trash2, Plus } from 'lucide-react';
|
|
16
16
|
import { toast } from 'sonner';
|
|
17
17
|
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Switch, } from '@asteby/metacore-ui/primitives';
|
|
18
|
-
import { useApi } from './api-context';
|
|
18
|
+
import { useApi } from './api-context.js';
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
// Pure helpers (exported for unit tests — no React, no transport)
|
|
21
21
|
// ---------------------------------------------------------------------------
|
package/dist/stage-layout.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// DELETE /stage-layout?model=<m> → reset to the declared order
|
|
16
16
|
import { unwrapResponse } from '@asteby/metacore-lib/envelope';
|
|
17
17
|
import { useCallback, useEffect, useState } from 'react';
|
|
18
|
-
import { useApi } from './api-context';
|
|
18
|
+
import { useApi } from './api-context.js';
|
|
19
19
|
/**
|
|
20
20
|
* Loads a model's saved lane order (only to learn availability + whether a
|
|
21
21
|
* custom order exists) and exposes save/reset. A missing endpoint degrades to
|
package/dist/stage-overrides.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// PUT /stage-overrides { model, stage_key, label?, color?, filters? } (upsert)
|
|
20
20
|
// DELETE /stage-overrides?model=<m>&stage_key=<k> → reset the lane to its declared default
|
|
21
21
|
import { useCallback, useEffect, useState } from 'react';
|
|
22
|
-
import { useApi } from './api-context';
|
|
22
|
+
import { useApi } from './api-context.js';
|
|
23
23
|
/**
|
|
24
24
|
* Learns whether the host wired `/stage-overrides` (so the gear can appear on
|
|
25
25
|
* declared lanes) and exposes save/reset. A missing endpoint degrades to
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// The grant is anchored to the record so it cannot be spent on another document.
|
|
10
10
|
import { useCallback } from 'react';
|
|
11
11
|
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import { useApprovalGate } from './approval-gate';
|
|
12
|
+
import { useApprovalGate } from './approval-gate.js';
|
|
13
13
|
/**
|
|
14
14
|
* Resolves the authorization for `action`, `{}` when it needs none, or null when
|
|
15
15
|
* the operator cancelled the PIN prompt (do NOT dispatch).
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { type RenderResult } from '@testing-library/react';
|
|
3
3
|
import type { AddonHostContext, HostApi } from '@asteby/metacore-sdk';
|
|
4
|
-
import { type AddonNavigateOptions, type PageChromeStore } from './addon-page-host';
|
|
4
|
+
import { type AddonNavigateOptions, type PageChromeStore } from './addon-page-host.js';
|
|
5
5
|
type Responder = unknown | ((path: string, body?: unknown) => unknown);
|
|
6
6
|
export interface MockHostApiRoutes {
|
|
7
7
|
get?: Record<string, Responder>;
|
package/dist/testing.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { HostApiError } from '@asteby/metacore-sdk';
|
|
4
|
-
import { AddonPageHost, createPageChromeStore, } from './addon-page-host';
|
|
4
|
+
import { AddonPageHost, createPageChromeStore, } from './addon-page-host.js';
|
|
5
5
|
/**
|
|
6
6
|
* In-memory {@link HostApi}. Unknown routes reject with a 404
|
|
7
7
|
* {@link HostApiError}, like a real host would.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TriStateBooleanFieldProps } from './tri-state-boolean-impl';
|
|
2
|
-
export type { TriStateBooleanFieldProps } from './tri-state-boolean-impl';
|
|
1
|
+
import type { TriStateBooleanFieldProps } from './tri-state-boolean-impl.js';
|
|
2
|
+
export type { TriStateBooleanFieldProps } from './tri-state-boolean-impl.js';
|
|
3
3
|
/**
|
|
4
4
|
* Control Sí / No / Sin definir para un booleano opcional. «Sin definir»
|
|
5
5
|
* envía `null`. Accesible (radiogroup con flechas) y con i18n es/en.
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
// shell inicial de la app.
|
|
6
6
|
import { Suspense, lazy } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
const Impl = lazy(() => import('./tri-state-boolean-impl').then((m) => ({ default: m.TriStateBooleanField })));
|
|
8
|
+
const Impl = lazy(() => import('./tri-state-boolean-impl.js').then((m) => ({ default: m.TriStateBooleanField })));
|
|
9
9
|
/**
|
|
10
10
|
* Control Sí / No / Sin definir para un booleano opcional. «Sin definir»
|
|
11
11
|
* envía `null`. Accesible (radiogroup con flechas) y con i18n es/en.
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OptionFilter } from './option-filter';
|
|
1
|
+
import type { OptionFilter } from './option-filter.js';
|
|
2
2
|
import type { ModelDetail, NavView } from '@asteby/metacore-sdk';
|
|
3
3
|
/** One spreadsheet column of a model's import template. Mirrors the kernel's
|
|
4
4
|
* `modelbase.ImportColumn`. */
|
package/dist/upload-field.d.ts
CHANGED
package/dist/upload-field.js
CHANGED
|
@@ -13,10 +13,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
// field.maxSize and forwards field.storagePath as `storage_path`.
|
|
14
14
|
import { useCallback, useState } from 'react';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { getUploadConfig } from './dynamic-form-schema';
|
|
17
|
-
import { FilePickButton } from './file-pick-button';
|
|
18
|
-
import { useApi } from './api-context';
|
|
19
|
-
import { useImageUrl } from './image-url-context';
|
|
16
|
+
import { getUploadConfig } from './dynamic-form-schema.js';
|
|
17
|
+
import { FilePickButton } from './file-pick-button.js';
|
|
18
|
+
import { useApi } from './api-context.js';
|
|
19
|
+
import { useImageUrl } from './image-url-context.js';
|
|
20
20
|
/**
|
|
21
21
|
* Natural pixel size of an image file, measured client-side. Resolves `{}` for
|
|
22
22
|
* a non-image or when the browser cannot decode it — never throws, never
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
// false → 404 (not installed) or the provider says no
|
|
7
7
|
// undefined → still loading, or unknown (403/network error: never "absent")
|
|
8
8
|
import { useQuery } from '@tanstack/react-query';
|
|
9
|
-
import { useApi } from './api-context';
|
|
10
|
-
import { addonSettingsUrl } from './use-addon-settings';
|
|
11
|
-
import { useInstalledAddons } from './installed-addons-context';
|
|
9
|
+
import { useApi } from './api-context.js';
|
|
10
|
+
import { addonSettingsUrl } from './use-addon-settings.js';
|
|
11
|
+
import { useInstalledAddons } from './installed-addons-context.js';
|
|
12
12
|
export function useAddonInstalledProbe(addonKey, opts = {}) {
|
|
13
13
|
const api = useApi();
|
|
14
14
|
const ctx = useInstalledAddons();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SettingDefLike } from './genui/settings-block';
|
|
1
|
+
import type { SettingDefLike } from './genui/settings-block.js';
|
|
2
2
|
/** What `GET /addons/:key/settings` answers, normalised. */
|
|
3
3
|
export interface AddonSettingsPayload<T = Record<string, unknown>> {
|
|
4
4
|
/** Stored values (org, or the branch's resolution when `branchId` is given). */
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// jsonb directly — this hook is the client-read half of that contract.
|
|
23
23
|
import { useCallback, useMemo } from 'react';
|
|
24
24
|
import { useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
25
|
-
import { useApi } from './api-context';
|
|
25
|
+
import { useApi } from './api-context.js';
|
|
26
26
|
const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
27
27
|
/**
|
|
28
28
|
* Normalises the settings response. Envelope `{ success?, data, definitions?,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ColumnFilterConfig } from './dynamic-columns-shim';
|
|
2
|
-
import type { TableMetadata } from './types';
|
|
1
|
+
import type { ColumnFilterConfig } from './dynamic-columns-shim.js';
|
|
2
|
+
import type { TableMetadata } from './types.js';
|
|
3
3
|
export interface UseDynamicFiltersOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Static equality filters always applied (never shown as removable chips).
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
// factored here to guarantee both surfaces filter identically.
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useApi } from './api-context';
|
|
16
|
-
import { withBooleanUnsetOption } from './nullable-boolean';
|
|
17
|
-
import { DATE_CELL_TYPES } from './dynamic-columns';
|
|
18
|
-
import { getSearchableColumnKeys } from './column-visibility';
|
|
19
|
-
import { useDebouncedValue } from './use-debounced-value';
|
|
20
|
-
import { useFacetLoaders, isLongTextColumn } from './use-facet-loaders';
|
|
15
|
+
import { useApi } from './api-context.js';
|
|
16
|
+
import { withBooleanUnsetOption } from './nullable-boolean.js';
|
|
17
|
+
import { DATE_CELL_TYPES } from './dynamic-columns.js';
|
|
18
|
+
import { getSearchableColumnKeys } from './column-visibility.js';
|
|
19
|
+
import { useDebouncedValue } from './use-debounced-value.js';
|
|
20
|
+
import { useFacetLoaders, isLongTextColumn } from './use-facet-loaders.js';
|
|
21
21
|
/**
|
|
22
22
|
* Reads the model's filter metadata and returns the live filter state + the
|
|
23
23
|
* serialized request params. Pure of any view concern — DynamicTable adds its
|
|
@@ -46,7 +46,7 @@ export declare function useEdgeDevice(capability: string, opts?: UseEdgeDeviceOp
|
|
|
46
46
|
* const send = useSendEdgeDeviceCommand()
|
|
47
47
|
* await send.mutateAsync({ deviceId: device.id, command: { type: 'print', payload } })
|
|
48
48
|
*/
|
|
49
|
-
export declare function sendEdgeDeviceCommand(api: Pick<import('./api-context').ApiClient, 'post'>, deviceId: string, command: Record<string, unknown>): Promise<unknown>;
|
|
49
|
+
export declare function sendEdgeDeviceCommand(api: Pick<import('./api-context.js').ApiClient, 'post'>, deviceId: string, command: Record<string, unknown>): Promise<unknown>;
|
|
50
50
|
export interface SendEdgeDeviceCommandArgs {
|
|
51
51
|
deviceId: string;
|
|
52
52
|
command: Record<string, unknown>;
|
package/dist/use-edge-device.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
// the app. Do not add a QueryClientProvider here.
|
|
14
14
|
import { useMemo } from 'react';
|
|
15
15
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
16
|
-
import { useApi } from './api-context';
|
|
17
|
-
import { useCurrentBranch } from './api-context';
|
|
16
|
+
import { useApi } from './api-context.js';
|
|
17
|
+
import { useCurrentBranch } from './api-context.js';
|
|
18
18
|
/** Stable react-query key for the org's edge device list. */
|
|
19
19
|
export function edgeDevicesKey() {
|
|
20
20
|
return ['edge-devices'];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// identically (one board and its table sibling hit the same `/facets` endpoint
|
|
6
6
|
// with the same caching).
|
|
7
7
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
-
import { useApi } from './api-context';
|
|
8
|
+
import { useApi } from './api-context.js';
|
|
9
9
|
/**
|
|
10
10
|
* Long-text / body columns aren't worth faceting (thousands of unique values,
|
|
11
11
|
* each a paragraph). Heuristic on the metadata, not a hardcoded name list:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
import { type MotionDuration, type MotionEasing } from './motion';
|
|
2
|
+
import { type MotionDuration, type MotionEasing } from './motion.js';
|
|
3
3
|
export interface UseFlipAnimationOptions {
|
|
4
4
|
/** Elements to animate, queried inside the root. */
|
|
5
5
|
selector?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
|
-
import { motionDuration, motionEasing, prefersReducedMotion, } from './motion';
|
|
2
|
+
import { motionDuration, motionEasing, prefersReducedMotion, } from './motion.js';
|
|
3
3
|
const DEFAULT_SELECTOR = '[data-flip-key]';
|
|
4
4
|
const MOTION_EASING_KEYS = { standard: 1, emphasized: 1, exit: 1 };
|
|
5
5
|
const defaultKeyOf = (el) => el.dataset.flipKey ?? el.getAttribute('href') ?? (el.textContent?.trim() || null);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type HostApiClient } from './host-api-client';
|
|
1
|
+
import { type HostApiClient, type HostApiClientOptions } from './host-api-client.js';
|
|
2
2
|
/**
|
|
3
3
|
* The addon's HTTP client, built over the host-injected HostApi. Works inside
|
|
4
4
|
* <AddonPageHost> (pages) and <HostApiProvider> (modals, pickers). Without a
|
|
5
5
|
* host it throws a clear error: there is no localStorage / fetch fallback.
|
|
6
6
|
*/
|
|
7
|
-
export declare function useHostApiClient(): HostApiClient;
|
|
7
|
+
export declare function useHostApiClient(options?: HostApiClientOptions): HostApiClient;
|
|
8
8
|
//# sourceMappingURL=use-host-api-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-host-api-client.d.ts","sourceRoot":"","sources":["../src/use-host-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-host-api-client.d.ts","sourceRoot":"","sources":["../src/use-host-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAEtG;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAK9E"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useHostApi } from './addon-page-host';
|
|
3
|
-
import { createHostApiClient } from './host-api-client';
|
|
2
|
+
import { useHostApi } from './addon-page-host.js';
|
|
3
|
+
import { createHostApiClient } from './host-api-client.js';
|
|
4
4
|
/**
|
|
5
5
|
* The addon's HTTP client, built over the host-injected HostApi. Works inside
|
|
6
6
|
* <AddonPageHost> (pages) and <HostApiProvider> (modals, pickers). Without a
|
|
7
7
|
* host it throws a clear error: there is no localStorage / fetch fallback.
|
|
8
8
|
*/
|
|
9
|
-
export function useHostApiClient() {
|
|
9
|
+
export function useHostApiClient(options) {
|
|
10
10
|
const api = useHostApi();
|
|
11
|
-
|
|
11
|
+
const key = options?.defaultHeaders ? JSON.stringify(options.defaultHeaders) : '';
|
|
12
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
+
return useMemo(() => createHostApiClient(api, options), [api, key]);
|
|
12
14
|
}
|
package/dist/use-option-ids.d.ts
CHANGED
package/dist/use-option-ids.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
// understood `ids`, so a requested id absent from it is `missing`.
|
|
21
21
|
import { useContext, useMemo } from 'react';
|
|
22
22
|
import { QueryClient, QueryClientContext, useQueries } from '@tanstack/react-query';
|
|
23
|
-
import { useApi } from './api-context';
|
|
24
|
-
import { onOptionsCacheInvalidated, optionsScope, projectOption } from './use-options-resolver';
|
|
23
|
+
import { useApi } from './api-context.js';
|
|
24
|
+
import { onOptionsCacheInvalidated, optionsScope, projectOption } from './use-options-resolver.js';
|
|
25
25
|
/** Ids the kernel accepts per request (dynamic.MaxOptionsIDs). */
|
|
26
26
|
export const OPTION_IDS_CHUNK = 100;
|
|
27
27
|
const OPTION_IDS_TTL_MS = 30_000;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type OptionFilterRule } from './option-filter';
|
|
2
|
-
import type { OptionDisplayData } from './option-display';
|
|
1
|
+
import { type OptionFilterRule } from './option-filter.js';
|
|
2
|
+
import type { OptionDisplayData } from './option-display.js';
|
|
3
3
|
export interface ResolvedOption {
|
|
4
4
|
/** Canonical id (server-side primary key). */
|
|
5
5
|
id: string | number;
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
// adopt Ref via the kernel auto-derivation get the right behaviour for
|
|
12
12
|
// free; legacy callers that still ship `searchEndpoint` keep working.
|
|
13
13
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
14
|
-
import { useApi } from './api-context';
|
|
15
|
-
import { cacheScope, onCacheScopeChange } from './cache-scope';
|
|
16
|
-
import { applyOptionFilter } from './option-filter';
|
|
17
|
-
import { loadQueryPart, optionsBatchToken, optionsModelFromUrl } from './query-batch';
|
|
14
|
+
import { useApi } from './api-context.js';
|
|
15
|
+
import { cacheScope, onCacheScopeChange } from './cache-scope.js';
|
|
16
|
+
import { applyOptionFilter } from './option-filter.js';
|
|
17
|
+
import { loadQueryPart, optionsBatchToken, optionsModelFromUrl } from './query-batch.js';
|
|
18
18
|
/**
|
|
19
19
|
* Resolves select options for a field via the canonical
|
|
20
20
|
* `/api/options/:model?field=…` endpoint. Returns the v0.9.0 envelope
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { unwrapResponse } from '@asteby/metacore-lib/envelope';
|
|
17
17
|
import { useCallback, useMemo } from 'react';
|
|
18
18
|
import { useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
19
|
-
import { useApi } from './api-context';
|
|
19
|
+
import { useApi } from './api-context.js';
|
|
20
20
|
export function orgDocumentCatalogKey() {
|
|
21
21
|
return ['org-document-templates'];
|
|
22
22
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
// this hook constructs no client of its own.
|
|
19
19
|
import { useCallback } from 'react';
|
|
20
20
|
import { toast } from 'sonner';
|
|
21
|
-
import { useApi } from './api-context';
|
|
21
|
+
import { useApi } from './api-context.js';
|
|
22
22
|
const noun = (mode) => mode === 'download' ? 'Descargando documento…' : mode === 'open' ? 'Abriendo documento…' : 'Preparando impresión…';
|
|
23
23
|
const readyMessage = (mode) => mode === 'download' ? 'Documento descargado' : mode === 'open' ? 'Documento abierto' : 'Documento listo para imprimir';
|
|
24
24
|
/** Best-effort message from an error whose body is a Blob (responseType: 'blob'). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { subscribeRecordMutations } from './record-mutation-events';
|
|
2
|
+
import { subscribeRecordMutations } from './record-mutation-events.js';
|
|
3
3
|
/**
|
|
4
4
|
* A counter that increments whenever a record of `model` is created, updated
|
|
5
5
|
* or deleted anywhere in the app. Fold it into a list's refetch deps.
|
package/dist/validator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ActionFieldDef, FieldValidation } from './types';
|
|
2
|
-
import type { FieldIssue } from './server-error';
|
|
1
|
+
import type { ActionFieldDef, FieldValidation } from './types.js';
|
|
2
|
+
import type { FieldIssue } from './server-error.js';
|
|
3
3
|
export interface ValidationSpec {
|
|
4
4
|
required?: boolean;
|
|
5
5
|
type?: string;
|
package/dist/validator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyOptionWhen, getDependsOn } from './option-when';
|
|
1
|
+
import { applyOptionWhen, getDependsOn } from './option-when.js';
|
|
2
2
|
const NIL_UUID = '00000000-0000-0000-0000-000000000000';
|
|
3
3
|
const NUMERIC_TYPES = new Set(['int', 'integer', 'bigint', 'decimal', 'numeric', 'number', 'float', 'double']);
|
|
4
4
|
const RULE_NAMES = new Set([
|
|
@@ -3,8 +3,8 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { useQuery } from '@tanstack/react-query';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Button } from '@asteby/metacore-ui/primitives';
|
|
6
|
-
import { useApi } from '../api-context';
|
|
7
|
-
import { ConfigurableCard } from './card-spec';
|
|
6
|
+
import { useApi } from '../api-context.js';
|
|
7
|
+
import { ConfigurableCard } from './card-spec.js';
|
|
8
8
|
/** Card grid over the same list endpoint DynamicTable uses; "load more" pagination. */
|
|
9
9
|
export function CardsView({ model, endpoint, card, params, pageSize = 24, onOpen, onTotal, refreshTrigger }) {
|
|
10
10
|
const api = useApi();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export { parseViewState, serializeViewState, viewStateToParams, isViewStateEmpty, EMPTY_VIEW_STATE } from './view-state';
|
|
3
|
-
export { useViewMode, resolveViewMode, viewPrefKey, DEFAULT_MODES, type UseViewModeOptions } from './use-view-mode';
|
|
4
|
-
export { ViewSwitcher, type ViewSwitcherProps } from './view-switcher';
|
|
5
|
-
export { ViewToolbar, type ViewToolbarProps } from './view-toolbar';
|
|
6
|
-
export { useSavedViews, localSavedViewsAdapter, upsertSavedView, removeSavedView, MAX_SAVED_VIEWS, type SavedViewsAdapter } from './saved-views';
|
|
7
|
-
export { ConfigurableCard, resolveCard, type ResolvedCard } from './card-spec';
|
|
8
|
-
export { CardsView, type CardsViewProps } from './cards-view';
|
|
9
|
-
export { ModelView, type ModelViewProps, type ModelViewRendererProps } from './model-view';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { parseViewState, serializeViewState, viewStateToParams, isViewStateEmpty, EMPTY_VIEW_STATE } from './view-state.js';
|
|
3
|
+
export { useViewMode, resolveViewMode, viewPrefKey, DEFAULT_MODES, type UseViewModeOptions } from './use-view-mode.js';
|
|
4
|
+
export { ViewSwitcher, type ViewSwitcherProps } from './view-switcher.js';
|
|
5
|
+
export { ViewToolbar, type ViewToolbarProps } from './view-toolbar.js';
|
|
6
|
+
export { useSavedViews, localSavedViewsAdapter, upsertSavedView, removeSavedView, MAX_SAVED_VIEWS, type SavedViewsAdapter } from './saved-views.js';
|
|
7
|
+
export { ConfigurableCard, resolveCard, type ResolvedCard } from './card-spec.js';
|
|
8
|
+
export { CardsView, type CardsViewProps } from './cards-view.js';
|
|
9
|
+
export { ModelView, type ModelViewProps, type ModelViewRendererProps } from './model-view.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|