@chelone/vue 0.7.0 → 0.10.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/dist/admin/admin.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/admin/auth-gate.js +1 -3
- package/dist/admin/resource-view.d.ts +8 -0
- package/dist/admin/resource-view.js +19 -0
- package/dist/auth/permissions-hooks.js +1 -3
- package/dist/choices/choices-context.d.ts +1 -2
- package/dist/choices/use-choices.d.ts +3 -3
- package/dist/choices/use-choices.js +13 -10
- package/dist/choices/use-reference-input.js +4 -4
- package/dist/components/admin/auth/auth-error.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/auth/auth-layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/auth/can-access.vue.d.ts +2 -2
- package/dist/components/admin/auth/login-form.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/auth/login-with-email.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/buttons/bulk-update-button.vue.d.ts +19 -6
- package/dist/components/admin/buttons/bulk-update-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/clone-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/clone-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/delete-button.vue.d.ts +19 -10
- package/dist/components/admin/buttons/delete-button.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/buttons/dual-approval-button.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/admin/buttons/edit-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/edit-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/export-button.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/buttons/fields-selector.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/buttons/filter-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/record-button-props.d.ts +12 -0
- package/dist/components/admin/buttons/show-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/show-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/status-transition-button.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/buttons/update-button.vue.d.ts +28 -24
- package/dist/components/admin/buttons/update-button.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/common/application-updated-notification.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/common/i18n-key-editor.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/csv-import/csv-import.vue_vue_type_script_setup_true_lang.js +2 -5
- package/dist/components/admin/feedback/error.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/feedback/linear-progress.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/feedback/loading.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/components/admin/feedback/placeholder.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/fields/api-key-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/api-key-field.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/fields/array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/badge-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/boolean-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/chip-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/color-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/cron-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/currency-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/date-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/diff-viewer.vue.d.ts +3 -3
- package/dist/components/admin/fields/duration-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/email-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/field-props.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/image-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/json-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/number-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/admin/fields/rating-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/rating-field.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/reference-array-field.vue.d.ts +20 -10
- package/dist/components/admin/fields/reference-field.vue.d.ts +22 -35
- package/dist/components/admin/fields/reference-many-count.vue.d.ts +20 -5
- package/dist/components/admin/fields/reference-many-field.vue.d.ts +20 -12
- package/dist/components/admin/fields/reference-one-field.vue.d.ts +22 -12
- package/dist/components/admin/fields/select-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/url-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/webhook-endpoint-field.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/fields/wrapper-field.vue.d.ts +21 -11
- package/dist/components/admin/inputs/api-key-input.vue.d.ts +20 -5
- package/dist/components/admin/inputs/api-key-input.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/inputs/array-input-row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/checkbox-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/date-input-format.d.ts +4 -1
- package/dist/components/admin/inputs/date-input-format.js +10 -1
- package/dist/components/admin/inputs/date-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/date-time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/duration-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/image-input-thumbnail.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/components/admin/inputs/image-input.vue.d.ts +1 -0
- package/dist/components/admin/inputs/image-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/inputs/in-place-editor-form.vue.d.ts +3 -3
- package/dist/components/admin/inputs/in-place-editor-form.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/in-place-editor.vue.d.ts +3 -3
- package/dist/components/admin/inputs/number-input.vue.d.ts +6 -0
- package/dist/components/admin/inputs/number-input.vue_vue_type_script_setup_true_lang.js +9 -0
- package/dist/components/admin/inputs/password-input.vue_vue_type_script_setup_true_lang.js +34 -30
- package/dist/components/admin/inputs/phone-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/radio-button-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/rating-input.vue_vue_type_script_setup_true_lang.js +24 -12
- package/dist/components/admin/inputs/reference-input.vue.d.ts +1 -1
- package/dist/components/admin/inputs/reference-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +6 -4
- package/dist/components/admin/inputs/resettable-text-input.vue_vue_type_script_setup_true_lang.js +44 -39
- package/dist/components/admin/inputs/subscription-plan-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/inputs/text-input.vue.d.ts +13 -2
- package/dist/components/admin/inputs/text-input.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/admin/inputs/time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/use-choice-input.d.ts +2 -2
- package/dist/components/admin/layout/app-sidebar.vue.d.ts +12 -1
- package/dist/components/admin/layout/app-sidebar.vue_vue_type_script_setup_true_lang.js +15 -11
- package/dist/components/admin/layout/command-menu-content.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/command-menu.vue.d.ts +1 -1
- package/dist/components/admin/layout/command-menu.vue_vue_type_script_setup_true_lang.js +9 -63
- package/dist/components/admin/layout/data-provider-devtools-entry.vue.d.ts +1 -1
- package/dist/components/admin/layout/data-provider-devtools-entry.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js +62 -28
- package/dist/components/admin/layout/icons.d.ts +2 -0
- package/dist/components/admin/layout/icons.js +3 -1
- package/dist/components/admin/layout/layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/menu-item-link.vue.d.ts +5 -0
- package/dist/components/admin/layout/menu-item-link.vue_vue_type_script_setup_true_lang.js +27 -8
- package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/layout/resource-menu-item-group.vue.d.ts +8 -1
- package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/components/admin/layout/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/layout/title-portal-id.d.ts +1 -1
- package/dist/components/admin/layout/title-portal-id.js +1 -9
- package/dist/components/admin/layout/top-toolbar.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/list/approval-queue-row.vue.d.ts +2 -2
- package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/approval-queue.vue.d.ts +3 -3
- package/dist/components/admin/list/calendar-agenda-view.vue.d.ts +23 -15
- package/dist/components/admin/list/calendar-event.vue.d.ts +21 -8
- package/dist/components/admin/list/calendar-list.vue.d.ts +29 -56
- package/dist/components/admin/list/calendar-list.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/admin/list/calendar-month-view.vue.d.ts +26 -20
- package/dist/components/admin/list/calendar-month-view.vue_vue_type_script_setup_true_lang.js +2 -6
- package/dist/components/admin/list/calendar-week-view.vue.d.ts +24 -17
- package/dist/components/admin/list/data-table-col.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/components/admin/list/data-table-context.d.ts +9 -6
- package/dist/components/admin/list/data-table-context.js +9 -1
- package/dist/components/admin/list/data-table-row.vue.d.ts +19 -15
- package/dist/components/admin/list/data-table-row.vue_vue_type_script_setup_true_lang.js +5 -9
- package/dist/components/admin/list/data-table.vue.d.ts +35 -23
- package/dist/components/admin/list/data-table.vue_vue_type_script_setup_true_lang.js +4 -7
- package/dist/components/admin/list/list-pagination.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/pivot-grid.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/list/simple-list-item.vue.d.ts +21 -19
- package/dist/components/admin/list/simple-list-item.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/list/simple-list.vue.d.ts +28 -20
- package/dist/components/admin/list/single-field-list-record.vue.d.ts +19 -9
- package/dist/components/admin/list/single-field-list.vue.d.ts +21 -11
- package/dist/components/admin/list/tree-list-context.d.ts +11 -6
- package/dist/components/admin/list/tree-list-node.vue.d.ts +19 -4
- package/dist/components/admin/list/tree-list.vue.d.ts +28 -37
- package/dist/components/admin/realtime/comments-thread.vue_vue_type_script_setup_true_lang.js +56 -44
- package/dist/components/admin/realtime/menu-live.vue.d.ts +3 -1
- package/dist/components/admin/realtime/menu-live.vue_vue_type_script_setup_true_lang.js +42 -12
- package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/use-password-recovery.js +11 -1
- package/dist/components/admin/view/create.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/edit.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/show.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/widgets/job-monitor-row.vue.d.ts +24 -11
- package/dist/components/admin/widgets/job-monitor.vue.d.ts +3 -3
- package/dist/components/admin/widgets/job-monitor.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/block-editor/block-doc-field.vue.d.ts +3 -3
- package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/charts/bar-chart.vue.d.ts +6 -2
- package/dist/components/charts/bar-chart.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/charts/series-chart.d.ts +1 -1
- package/dist/components/charts/series-chart.js +9 -3
- package/dist/components/index.js +2 -2
- package/dist/components/inspector/configurable.vue.d.ts +0 -21
- package/dist/components/inspector/configurable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/inspector/inspector.vue_vue_type_script_setup_true_lang.js +6 -8
- package/dist/components/kanban/kanban-board.vue.d.ts +3 -3
- package/dist/components/kanban/kanban-board.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/maps/bbox-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-layers.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/geo-json-view.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/maps/lat-lng-field.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/maps/lat-lng-input.vue_vue_type_script_setup_true_lang.js +5 -7
- package/dist/components/maps/map-canvas.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/use-map.js +1 -3
- package/dist/components/maps-draw/shape-input.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/maps-draw/simplify-input.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/maps-osm/geocoding-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/maps-osm/map-with-search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/mdx-editor/mdx-editor-theme.css +47 -0
- package/dist/components/mdx-editor/mdx-field.vue.d.ts +21 -11
- package/dist/components/mdx-editor/mdx-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/monaco/internal/use-json-schema.js +1 -2
- package/dist/components/monaco/internal/use-monaco-markers.d.ts +0 -6
- package/dist/components/monaco/internal/use-monaco-markers.js +4 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/monaco/monaco-json-field.vue.d.ts +3 -3
- package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/rich-text-input/rich-text-field.vue.d.ts +3 -3
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +4 -4
- package/dist/components/ui/button-variants.js +1 -1
- package/dist/components/ui/chart/chart-container.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/command/command-dialog.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-menu-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-parts.js +2 -2
- package/dist/components/ui/sidebar/sidebar.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/controllers/use-controller-for-id.d.ts +2 -2
- package/dist/controllers/use-prev-next-controller.d.ts +2 -2
- package/dist/controllers/use-reference-many-field-controller.d.ts +4 -4
- package/dist/controllers/use-reference-one-field-controller.d.ts +4 -4
- package/dist/create-resource-components.d.ts +225 -117
- package/dist/data/undoable.js +2 -2
- package/dist/form/use-form.d.ts +5 -3
- package/dist/form/use-form.js +1 -1
- package/dist/form/use-input.d.ts +0 -2
- package/dist/form/use-input.js +1 -2
- package/dist/index.js +2 -2
- package/dist/resource-context.d.ts +5 -1
- package/dist/resource-context.js +4 -0
- package/dist/router/use-get-path-for-record.d.ts +3 -3
- package/package.json +5 -5
|
@@ -17,7 +17,7 @@ import { ArrowRightLeftIcon } from "../admin/list/list-icons.js";
|
|
|
17
17
|
import kanban_draggable_card_default from "./kanban-draggable-card.js";
|
|
18
18
|
import kanban_drop_area_default from "./kanban-drop-area.js";
|
|
19
19
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
20
|
-
import { buildKanbanBuckets, getAtPath, planKanbanMove } from "@chelone/core";
|
|
20
|
+
import { buildKanbanBuckets, getAtPath, isLooseRecord, planKanbanMove } from "@chelone/core";
|
|
21
21
|
import { PointerSensor } from "@dnd-kit/dom";
|
|
22
22
|
import { DragDropProvider } from "@dnd-kit/vue";
|
|
23
23
|
// src/components/kanban/kanban-board.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -115,9 +115,14 @@ var kanban_board_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
115
115
|
};
|
|
116
116
|
const buckets = computed(() => buildKanbanBuckets(list.data ?? [], props.groupSource, props.columns));
|
|
117
117
|
function move(record, targetColumnId) {
|
|
118
|
+
if (!isLooseRecord(record)) return;
|
|
118
119
|
const plan = planKanbanMove(record, props.groupSource, props.columns, targetColumnId);
|
|
119
120
|
if (!plan) return;
|
|
120
|
-
update.mutateAsync(
|
|
121
|
+
update.mutateAsync({
|
|
122
|
+
id: plan.id,
|
|
123
|
+
data: plan.data,
|
|
124
|
+
previousData: record
|
|
125
|
+
}).catch(() => {
|
|
121
126
|
notifications?.notify("chelone.notification.http_error", { type: "error" });
|
|
122
127
|
});
|
|
123
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFieldValue } from "../../record/use-field-value.js";
|
|
2
2
|
import geo_json_field_default from "./geo-json-field.js";
|
|
3
3
|
import { computed, createBlock, defineComponent, normalizeClass, openBlock } from "vue";
|
|
4
|
-
import { bboxToPolygon } from "@chelone/core";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAX_FIT_ZOOM, bboxToPolygon } from "@chelone/core";
|
|
5
5
|
// src/components/maps/bbox-field.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "bbox-field",
|
|
@@ -10,7 +10,7 @@ var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
10
10
|
record: {},
|
|
11
11
|
defaultValue: {},
|
|
12
12
|
emptyText: {},
|
|
13
|
-
height: { default:
|
|
13
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
14
14
|
mapStyle: {},
|
|
15
15
|
scrollZoom: {
|
|
16
16
|
type: Boolean,
|
|
@@ -22,8 +22,8 @@ var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: true
|
|
24
24
|
},
|
|
25
|
-
fitPadding: { default:
|
|
26
|
-
maxFitZoom: { default:
|
|
25
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
26
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
27
27
|
},
|
|
28
28
|
setup(__props) {
|
|
29
29
|
/**
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
3
3
|
import { useFieldValue } from "../../record/use-field-value.js";
|
|
4
4
|
import geo_json_view_default from "./geo-json-view.js";
|
|
5
5
|
import { computed, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref } from "vue";
|
|
6
|
-
import { geoBounds, isGeoJsonValue, isLngLatBox } from "@chelone/core";
|
|
6
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAX_FIT_ZOOM, geoBounds, isGeoJsonValue, isLngLatBox } from "@chelone/core";
|
|
7
7
|
// src/components/maps/geo-json-field.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
__name: "geo-json-field",
|
|
@@ -12,7 +12,7 @@ var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
12
12
|
record: {},
|
|
13
13
|
defaultValue: {},
|
|
14
14
|
emptyText: {},
|
|
15
|
-
height: { default:
|
|
15
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
16
16
|
mapStyle: {},
|
|
17
17
|
scrollZoom: {
|
|
18
18
|
type: Boolean,
|
|
@@ -24,8 +24,8 @@ var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: true
|
|
26
26
|
},
|
|
27
|
-
fitPadding: { default:
|
|
28
|
-
maxFitZoom: { default:
|
|
27
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
28
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
29
29
|
},
|
|
30
30
|
setup(__props) {
|
|
31
31
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uniqueGeoJsonSourceId, useGeoJsonSource } from "./use-geo-json-source.js";
|
|
2
2
|
import { useMap } from "./use-map.js";
|
|
3
3
|
import { computed, defineComponent, toRaw, watch } from "vue";
|
|
4
|
-
import { asFeatureCollection, geoBounds, isLngLatBox } from "@chelone/core";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAX_FIT_ZOOM, asFeatureCollection, geoBounds, isLngLatBox } from "@chelone/core";
|
|
5
5
|
// src/components/maps/geo-json-layers.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var geo_json_layers_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "geo-json-layers",
|
|
@@ -12,8 +12,8 @@ var geo_json_layers_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
12
12
|
type: Boolean,
|
|
13
13
|
default: true
|
|
14
14
|
},
|
|
15
|
-
fitPadding: { default:
|
|
16
|
-
maxFitZoom: { default:
|
|
15
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
16
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
19
19
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import geo_json_layers_default from "./geo-json-layers.js";
|
|
2
2
|
import map_canvas_default from "./map-canvas.js";
|
|
3
3
|
import { createBlock, createVNode, defineComponent, normalizeClass, openBlock, withCtx } from "vue";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAX_FIT_ZOOM } from "@chelone/core";
|
|
4
5
|
// src/components/maps/geo-json-view.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var geo_json_view_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
7
|
__name: "geo-json-view",
|
|
@@ -18,8 +19,8 @@ var geo_json_view_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
18
19
|
type: Boolean,
|
|
19
20
|
default: true
|
|
20
21
|
},
|
|
21
|
-
fitPadding: { default:
|
|
22
|
-
maxFitZoom: { default:
|
|
22
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
23
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
/**
|
|
@@ -4,6 +4,7 @@ import map_canvas_default from "./map-canvas.js";
|
|
|
4
4
|
import { useCoordinates } from "./use-coordinates.js";
|
|
5
5
|
import { MapMarker } from "./use-map.js";
|
|
6
6
|
import { computed, createBlock, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
7
|
+
import { DEFAULT_MAP_HEIGHT, LATITUDE_LIMIT, LONGITUDE_LIMIT } from "@chelone/core";
|
|
7
8
|
// src/components/maps/lat-lng-field.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var lat_lng_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
10
|
__name: "lat-lng-field",
|
|
@@ -32,10 +33,10 @@ var lat_lng_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
32
33
|
function inRange(value, limit) {
|
|
33
34
|
return value !== null && Math.abs(value) <= limit ? value : null;
|
|
34
35
|
}
|
|
35
|
-
const lat = computed(() => inRange(coordinates.lat.value,
|
|
36
|
-
const lng = computed(() => inRange(coordinates.lng.value,
|
|
36
|
+
const lat = computed(() => inRange(coordinates.lat.value, LATITUDE_LIMIT));
|
|
37
|
+
const lng = computed(() => inRange(coordinates.lng.value, LONGITUDE_LIMIT));
|
|
37
38
|
const cssHeight = computed(() => {
|
|
38
|
-
const height = props.height ??
|
|
39
|
+
const height = props.height ?? DEFAULT_MAP_HEIGHT;
|
|
39
40
|
return typeof height === "number" ? `${height}px` : height;
|
|
40
41
|
});
|
|
41
42
|
return (_ctx, _cache) => {
|
|
@@ -9,7 +9,7 @@ import input_default from "../ui/input.js";
|
|
|
9
9
|
import map_canvas_default from "./map-canvas.js";
|
|
10
10
|
import { MapMarker, useMap } from "./use-map.js";
|
|
11
11
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, toDisplayString, unref, watch, withCtx } from "vue";
|
|
12
|
-
import { latitude, longitude, toCoordinate } from "@chelone/core";
|
|
12
|
+
import { DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, LATITUDE_LIMIT, LONGITUDE_LIMIT, latitude, longitude, toCoordinate, wrapLongitude } from "@chelone/core";
|
|
13
13
|
// src/components/maps/lat-lng-input.vue?vue&type=script&setup=true&lang.ts
|
|
14
14
|
var _hoisted_1 = ["data-invalid"];
|
|
15
15
|
var _hoisted_2 = {
|
|
@@ -80,8 +80,8 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
80
80
|
latValidate: {},
|
|
81
81
|
lngValidate: {},
|
|
82
82
|
defaultPosition: { default: () => [0, 0] },
|
|
83
|
-
zoom: { default:
|
|
84
|
-
height: { default:
|
|
83
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
84
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
85
85
|
mapStyle: {},
|
|
86
86
|
disabled: {
|
|
87
87
|
type: Boolean,
|
|
@@ -111,8 +111,6 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
111
111
|
}
|
|
112
112
|
/** About 10 cm, so the text fields stay readable. */
|
|
113
113
|
const round6 = (value) => Math.round(value * 1e6) / 1e6;
|
|
114
|
-
/** A click on a repeated copy of the world reports a longitude past 180. */
|
|
115
|
-
const wrapLng = (lng) => Math.abs(lng) <= 180 ? lng : ((lng + 180) % 360 + 360) % 360 - 180;
|
|
116
114
|
/** Digits with an optional sign and point: what a coordinate looks like while it is typed. */
|
|
117
115
|
const TYPING = /^[+-]?\d*\.?\d*$/;
|
|
118
116
|
/** MapLibre throws on a coordinate outside its range. */
|
|
@@ -162,7 +160,7 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
162
160
|
const position = computed(() => {
|
|
163
161
|
const a = lat.stored.value;
|
|
164
162
|
const b = lng.stored.value;
|
|
165
|
-
return inRange(a,
|
|
163
|
+
return inRange(a, LATITUDE_LIMIT) && inRange(b, LONGITUDE_LIMIT) ? [a, b] : null;
|
|
166
164
|
});
|
|
167
165
|
const center = computed(() => position.value ?? props.defaultPosition);
|
|
168
166
|
const invalid = computed(() => lat.invalid.value || lng.invalid.value);
|
|
@@ -170,7 +168,7 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
170
168
|
const gesture = { current: null };
|
|
171
169
|
function place(rawLat, rawLng) {
|
|
172
170
|
const nextLat = round6(rawLat);
|
|
173
|
-
const nextLng = round6(
|
|
171
|
+
const nextLng = round6(wrapLongitude(rawLng));
|
|
174
172
|
gesture.current = [nextLat, nextLng];
|
|
175
173
|
lat.setValue(nextLat);
|
|
176
174
|
lat.blur();
|
|
@@ -2,7 +2,7 @@ import { useTranslate } from "../../i18n/use-translate.js";
|
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
3
|
import { provideMap, useMapsConfig } from "./use-map.js";
|
|
4
4
|
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref } from "vue";
|
|
5
|
-
import { latLngToLngLat } from "@chelone/core";
|
|
5
|
+
import { DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, latLngToLngLat } from "@chelone/core";
|
|
6
6
|
import { Map } from "maplibre-gl";
|
|
7
7
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
8
8
|
// src/components/maps/map-canvas.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,8 +16,8 @@ var map_canvas_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
16
16
|
__name: "map-canvas",
|
|
17
17
|
props: {
|
|
18
18
|
center: { default: () => [0, 0] },
|
|
19
|
-
zoom: { default:
|
|
20
|
-
height: { default:
|
|
19
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
20
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
21
21
|
mapStyle: {},
|
|
22
22
|
scrollZoom: {
|
|
23
23
|
type: Boolean,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, onBeforeUnmount, provide, toValue, watch } from "vue";
|
|
2
|
-
import { latLngToLngLat } from "@chelone/core";
|
|
2
|
+
import { DEFAULT_PIN_COLOR, PIN_NS, latLngToLngLat } from "@chelone/core";
|
|
3
3
|
import { Marker } from "maplibre-gl";
|
|
4
4
|
// src/components/maps/use-map.ts
|
|
5
5
|
var MapsConfigKey = Symbol("chelone-maps-config");
|
|
@@ -53,8 +53,6 @@ function useMap() {
|
|
|
53
53
|
if (!map) throw new Error("useMap must be used inside a <MapCanvas>.");
|
|
54
54
|
return map;
|
|
55
55
|
}
|
|
56
|
-
var PIN_NS = "http://www.w3.org/2000/svg";
|
|
57
|
-
var DEFAULT_PIN_COLOR = "#dc2626";
|
|
58
56
|
/** A pin whose tip is the bottom edge of the element. */
|
|
59
57
|
function createPin(color) {
|
|
60
58
|
const svg = document.createElementNS(PIN_NS, "svg");
|
|
@@ -13,7 +13,7 @@ import { uniqueGeoJsonSourceId, useGeoJsonSource } from "../maps/use-geo-json-so
|
|
|
13
13
|
import { useMap } from "../maps/use-map.js";
|
|
14
14
|
import { useTerraDraw } from "./use-terra-draw.js";
|
|
15
15
|
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, ref, shallowRef, toDisplayString, toRaw, unref, watch, withCtx } from "vue";
|
|
16
|
-
import { deepEqual, featuresToShape, geoBounds, heldFeatures, isLngLatBox, maxVertices, minAreaM2, minVertices, noSelfIntersection, shapeToFeatures } from "@chelone/core";
|
|
16
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, DEFAULT_MAX_FIT_ZOOM, deepEqual, featuresToShape, geoBounds, heldFeatures, isLngLatBox, maxVertices, minAreaM2, minVertices, noSelfIntersection, shapeToFeatures } from "@chelone/core";
|
|
17
17
|
// src/components/maps-draw/shape-input.vue?vue&type=script&setup=true&lang.ts
|
|
18
18
|
var _hoisted_1 = ["data-invalid"];
|
|
19
19
|
var _hoisted_2 = {
|
|
@@ -110,8 +110,8 @@ var Editor = defineComponent((props, { emit }) => {
|
|
|
110
110
|
if (props.getValue() === props.written.current) return;
|
|
111
111
|
if (!isLngLatBox(corners)) return;
|
|
112
112
|
map.fitBounds(corners, {
|
|
113
|
-
padding:
|
|
114
|
-
maxZoom:
|
|
113
|
+
padding: DEFAULT_FIT_PADDING,
|
|
114
|
+
maxZoom: DEFAULT_MAX_FIT_ZOOM,
|
|
115
115
|
duration: 0
|
|
116
116
|
});
|
|
117
117
|
}, { immediate: true });
|
|
@@ -200,8 +200,8 @@ var shape_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
200
200
|
default: false
|
|
201
201
|
},
|
|
202
202
|
defaultCenter: { default: () => [0, 0] },
|
|
203
|
-
zoom: { default:
|
|
204
|
-
height: { default:
|
|
203
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
204
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
205
205
|
mapStyle: { default: void 0 },
|
|
206
206
|
shapeStyle: { default: void 0 },
|
|
207
207
|
aspectRatio: { default: void 0 },
|
|
@@ -10,7 +10,7 @@ import button_default from "../ui/button.js";
|
|
|
10
10
|
import { FieldError } from "../ui/field.js";
|
|
11
11
|
import { simplifyGeo } from "./geometry-ops.js";
|
|
12
12
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, toDisplayString, toRaw, unref, watch, withCtx } from "vue";
|
|
13
|
-
import { deepEqual, isGeoJsonValue } from "@chelone/core";
|
|
13
|
+
import { DEFAULT_MAP_ZOOM, deepEqual, isGeoJsonValue } from "@chelone/core";
|
|
14
14
|
// src/components/maps-draw/simplify-input.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var _hoisted_1 = ["data-invalid"];
|
|
16
16
|
var _hoisted_2 = {
|
|
@@ -42,7 +42,7 @@ var simplify_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
42
42
|
type: [String, Boolean],
|
|
43
43
|
default: void 0
|
|
44
44
|
},
|
|
45
|
-
zoom: { default:
|
|
45
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
46
46
|
defaultCenter: { default: () => [0, 0] },
|
|
47
47
|
height: { default: 400 },
|
|
48
48
|
mapStyle: { default: void 0 },
|
|
@@ -155,7 +155,8 @@ var geocoding_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
155
155
|
const count = results.value.length;
|
|
156
156
|
if (count === 0) return;
|
|
157
157
|
open.value = true;
|
|
158
|
-
|
|
158
|
+
const current = active.value;
|
|
159
|
+
active.value = current < 0 ? step === 1 ? 0 : count - 1 : (current + step + count) % count;
|
|
159
160
|
}
|
|
160
161
|
function onBlur() {
|
|
161
162
|
open.value = false;
|
|
@@ -4,7 +4,7 @@ import lat_lng_input_default from "../maps/lat-lng-input.js";
|
|
|
4
4
|
import { useMapsConfig } from "../maps/use-map.js";
|
|
5
5
|
import geocoding_input_default from "./geocoding-input.js";
|
|
6
6
|
import { createElementBlock, createVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, unref } from "vue";
|
|
7
|
-
import { reverseGeocodeQueryOptions } from "@chelone/core";
|
|
7
|
+
import { DEFAULT_MAP_ZOOM, reverseGeocodeQueryOptions } from "@chelone/core";
|
|
8
8
|
import { useQueryClient } from "@tanstack/vue-query";
|
|
9
9
|
// src/components/maps-osm/map-with-search.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var map_with_search_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -14,7 +14,7 @@ var map_with_search_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
14
14
|
lngSource: {},
|
|
15
15
|
addressSource: {},
|
|
16
16
|
height: { default: 400 },
|
|
17
|
-
zoom: { default:
|
|
17
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
18
18
|
provider: {},
|
|
19
19
|
class: {}
|
|
20
20
|
},
|
|
@@ -23,3 +23,50 @@
|
|
|
23
23
|
--crepe-font-default: inherit;
|
|
24
24
|
--crepe-font-title: inherit;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Crepe's own page spacing and display-size headings suit a full-page editor.
|
|
29
|
+
* Inside a form the content sits at the width of the other inputs, with
|
|
30
|
+
* headings sized like the rest of the admin.
|
|
31
|
+
*/
|
|
32
|
+
.chelone-mdx-editor .milkdown .ProseMirror {
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.chelone-mdx-editor .milkdown .ProseMirror h1,
|
|
37
|
+
.chelone-mdx-editor .milkdown .ProseMirror h2,
|
|
38
|
+
.chelone-mdx-editor .milkdown .ProseMirror h3,
|
|
39
|
+
.chelone-mdx-editor .milkdown .ProseMirror h4 {
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
line-height: 1.25;
|
|
42
|
+
margin: 1em 0 0.5em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.chelone-mdx-editor .milkdown .ProseMirror h1 {
|
|
46
|
+
font-size: 1.875rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.chelone-mdx-editor .milkdown .ProseMirror h2 {
|
|
50
|
+
font-size: 1.5rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.chelone-mdx-editor .milkdown .ProseMirror h3 {
|
|
54
|
+
font-size: 1.25rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.chelone-mdx-editor .milkdown .ProseMirror h4 {
|
|
58
|
+
font-size: 1.125rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* The outline color is a border color: too faint for a list marker. */
|
|
62
|
+
.chelone-mdx-editor .milkdown .milkdown-list-item-block li .label-wrapper {
|
|
63
|
+
color: var(--crepe-color-on-surface-variant);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chelone-mdx-editor .milkdown .milkdown-list-item-block li .label-wrapper svg {
|
|
67
|
+
fill: var(--crepe-color-on-surface-variant);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.chelone-mdx-editor .milkdown .ProseMirror > :first-child {
|
|
71
|
+
margin-top: 0;
|
|
72
|
+
}
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* <MdxField source="body" empty="No content" />
|
|
15
15
|
*/
|
|
16
16
|
import { type VNode } from "vue";
|
|
17
|
-
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
17
|
+
import type { LooseRecord, ResourceRecord, SourceProp, SourceValue } from "@chelone/core";
|
|
18
18
|
import type { CrepeEditorConfig } from "./internal/crepe-editor.vue.js";
|
|
19
19
|
/** Props for {@link MdxField}. */
|
|
20
|
-
export interface MdxFieldProps {
|
|
21
|
-
source: SourceProp
|
|
22
|
-
record?:
|
|
20
|
+
export interface MdxFieldProps<RecordType extends ResourceRecord = LooseRecord> {
|
|
21
|
+
source: SourceProp<RecordType>;
|
|
22
|
+
record?: RecordType;
|
|
23
23
|
/** Used when the record has no value at `source`. */
|
|
24
|
-
defaultValue?:
|
|
24
|
+
defaultValue?: SourceValue<RecordType, SourceProp<RecordType>>;
|
|
25
25
|
/** Shown as the markdown when the value is missing; translated if it is a message key. */
|
|
26
26
|
empty?: string;
|
|
27
27
|
/** Merged under the read-only defaults; `code-mirror` and `latex` stay off. */
|
|
@@ -30,11 +30,21 @@ export interface MdxFieldProps {
|
|
|
30
30
|
}
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
32
32
|
export default _default;
|
|
33
|
-
declare const __VLS_export:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
declare const __VLS_export: <RecordType extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
34
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<MdxFieldProps<RecordType>> & (typeof globalThis extends {
|
|
35
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
36
|
+
} ? P : {});
|
|
37
|
+
expose: (exposed: {}) => void;
|
|
38
|
+
attrs: any;
|
|
39
|
+
slots: {
|
|
40
|
+
empty?: () => VNode[];
|
|
39
41
|
};
|
|
42
|
+
emit: {};
|
|
43
|
+
}>) => import("vue").VNode & {
|
|
44
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
40
45
|
};
|
|
46
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} : {
|
|
49
|
+
[K in keyof T as K]: T[K];
|
|
50
|
+
}) & {};
|
|
@@ -73,7 +73,10 @@ var mdx_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
73
73
|
])]),
|
|
74
74
|
_: 1
|
|
75
75
|
}, 8, ["html-for"])) : createCommentVNode("", true),
|
|
76
|
-
createElementVNode("div", {
|
|
76
|
+
createElementVNode("div", {
|
|
77
|
+
id: unref(id),
|
|
78
|
+
class: "overflow-hidden rounded-md border"
|
|
79
|
+
}, [createVNode(crepe_editor_default, {
|
|
77
80
|
markdown: markdown.value,
|
|
78
81
|
readonly: __props.disabled === true || __props.readOnly === true,
|
|
79
82
|
"crepe-config": __props.crepeConfig,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { computed, toValue, watchEffect } from "vue";
|
|
2
|
+
import { MODEL_PREFIX } from "@chelone/core";
|
|
2
3
|
// src/components/monaco/internal/use-json-schema.ts
|
|
3
|
-
/** Every model path this add-on creates starts with this. */
|
|
4
|
-
var MODEL_PREFIX = "inmemory://monaco-json-input/";
|
|
5
4
|
var shared = /* @__PURE__ */ new WeakMap();
|
|
6
5
|
function apply(defaults, state) {
|
|
7
6
|
const current = defaults.diagnosticsOptions;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type * as Monaco from "monaco-editor";
|
|
2
2
|
import type { editor } from "monaco-editor";
|
|
3
3
|
import { type Ref } from "vue";
|
|
4
|
-
/**
|
|
5
|
-
* How long after the last edit `settled` waits for Monaco's markers. Monaco
|
|
6
|
-
* posts them about 500 ms after an edit.
|
|
7
|
-
*/
|
|
8
|
-
export declare const MARKERS_SETTLE_MS = 750;
|
|
9
|
-
export declare const MONACO_DIAGNOSTICS_DELAY_MS = 500;
|
|
10
4
|
export interface MonacoMarkers {
|
|
11
5
|
markers: Ref<editor.IMarker[]>;
|
|
12
6
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { shallowRef, watch } from "vue";
|
|
2
|
+
import { MARKERS_SETTLE_MS, MONACO_DIAGNOSTICS_DELAY_MS } from "@chelone/core";
|
|
3
|
+
// src/components/monaco/internal/use-monaco-markers.ts
|
|
2
4
|
/**
|
|
3
5
|
* Keeps the editor model's current markers in a ref and calls `onChange` each
|
|
4
6
|
* time Monaco reports a change for that model. The ref is what a validator
|
|
@@ -22,7 +24,7 @@ function useMonacoMarkers(instance, monaco, onChange) {
|
|
|
22
24
|
const subscription = currentMonaco.editor.onDidChangeMarkers((uris) => {
|
|
23
25
|
if (!uris.some((uri) => uri.toString() === model.uri.toString())) return;
|
|
24
26
|
markers.value = read();
|
|
25
|
-
if (Date.now() - lastEditAt >=
|
|
27
|
+
if (Date.now() - lastEditAt >= MONACO_DIAGNOSTICS_DELAY_MS) {
|
|
26
28
|
fresh = true;
|
|
27
29
|
for (const release of [...waiting]) release();
|
|
28
30
|
}
|
|
@@ -41,7 +43,7 @@ function useMonacoMarkers(instance, monaco, onChange) {
|
|
|
41
43
|
waiting.delete(release);
|
|
42
44
|
resolve(markers.value);
|
|
43
45
|
};
|
|
44
|
-
const timer = setTimeout(release, Math.max(0, lastEditAt +
|
|
46
|
+
const timer = setTimeout(release, Math.max(0, lastEditAt + MARKERS_SETTLE_MS - Date.now()));
|
|
45
47
|
waiting.add(release);
|
|
46
48
|
});
|
|
47
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type LooseRecord, type ResourceRecord } from "@chelone/core";
|
|
2
2
|
import { type VNode } from "vue";
|
|
3
3
|
import type { MonacoJsonFieldProps } from "./monaco-json-field.vue.js";
|
|
4
|
-
declare const __VLS_export: <RecordType extends
|
|
4
|
+
declare const __VLS_export: <RecordType extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<MonacoJsonFieldProps<RecordType>> & (typeof globalThis extends {
|
|
6
6
|
__VLS_PROPS_FALLBACK: infer P;
|
|
7
7
|
} ? P : {});
|
package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,10 +3,10 @@ import { cn } from "../../lib/utils.js";
|
|
|
3
3
|
import { useFieldValue } from "../../record/use-field-value.js";
|
|
4
4
|
import { useAutoHeight, useMonacoLayout, useMonacoTheme } from "./internal/monaco-composables.js";
|
|
5
5
|
import { computed, createElementBlock, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, shallowRef, toDisplayString, unref } from "vue";
|
|
6
|
+
import { MONACO_MIN_HEIGHT } from "@chelone/core";
|
|
6
7
|
import { VueMonacoEditor, loader } from "@guolao/vue-monaco-editor";
|
|
7
8
|
import * as monaco from "monaco-editor";
|
|
8
9
|
// src/components/monaco/monaco-json-field-lazy.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var MIN_HEIGHT = 120;
|
|
10
10
|
var monaco_json_field_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
11
11
|
__name: "monaco-json-field-lazy",
|
|
12
12
|
props: {
|
|
@@ -40,7 +40,7 @@ var monaco_json_field_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
40
40
|
const text = computed(() => typeof value.value === "string" ? value.value : JSON.stringify(value.value ?? null, null, 2));
|
|
41
41
|
const instance = shallowRef(null);
|
|
42
42
|
const theme = useMonacoTheme();
|
|
43
|
-
const contentHeight = useAutoHeight(instance, () => props.autoHeight,
|
|
43
|
+
const contentHeight = useAutoHeight(instance, () => props.autoHeight, MONACO_MIN_HEIGHT, () => props.maxHeight);
|
|
44
44
|
const container = useMonacoLayout(instance);
|
|
45
45
|
const editorHeight = computed(() => `${props.autoHeight ? contentHeight.value : props.height}px`);
|
|
46
46
|
const options = computed(() => ({
|
|
@@ -48,6 +48,7 @@ var monaco_json_field_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
48
48
|
domReadOnly: true,
|
|
49
49
|
automaticLayout: false,
|
|
50
50
|
minimap: { enabled: false },
|
|
51
|
+
scrollBeyondLastLine: false,
|
|
51
52
|
lineNumbers: "on",
|
|
52
53
|
wordWrap: "on",
|
|
53
54
|
tabSize: 2,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, ResourceRecord } from "@chelone/core";
|
|
2
2
|
import type { editor } from "monaco-editor";
|
|
3
3
|
import type { FieldProps } from "../admin/fields/field-props.js";
|
|
4
4
|
/** Props for {@link MonacoJsonField}. */
|
|
5
|
-
export interface MonacoJsonFieldProps<RecordType extends
|
|
5
|
+
export interface MonacoJsonFieldProps<RecordType extends ResourceRecord = LooseRecord> extends FieldProps<RecordType> {
|
|
6
6
|
/** Editor height in pixels when `autoHeight` is false. Defaults to 200. */
|
|
7
7
|
height?: number;
|
|
8
8
|
/** Grow with the content up to `maxHeight`. Defaults to true. */
|
|
@@ -31,7 +31,7 @@ export interface MonacoJsonFieldProps<RecordType extends LooseRecord = LooseReco
|
|
|
31
31
|
*/
|
|
32
32
|
declare const _default: typeof __VLS_export;
|
|
33
33
|
export default _default;
|
|
34
|
-
declare const __VLS_export: <RecordType extends
|
|
34
|
+
declare const __VLS_export: <RecordType extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
35
35
|
attrs: any;
|
|
36
36
|
slots: {
|
|
37
37
|
empty?: () => import("vue").VNode[];
|
package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -11,7 +11,7 @@ import { useAutoHeight, useMonacoLayout, useMonacoTheme } from "./internal/monac
|
|
|
11
11
|
import { useJsonSchema } from "./internal/use-json-schema.js";
|
|
12
12
|
import { useMonacoMarkers } from "./internal/use-monaco-markers.js";
|
|
13
13
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, shallowRef, toDisplayString, unref, watch, withCtx } from "vue";
|
|
14
|
-
import { composeValidators, detectJsonShape, fromJsonText, stripJsonComments, toJsonText } from "@chelone/core";
|
|
14
|
+
import { ERROR_SEVERITY, MODEL_PREFIX, composeValidators, detectJsonShape, fromJsonText, stripJsonComments, toJsonText } from "@chelone/core";
|
|
15
15
|
import { VueMonacoEditor, loader } from "@guolao/vue-monaco-editor";
|
|
16
16
|
import * as monaco from "monaco-editor";
|
|
17
17
|
// src/components/monaco/monaco-json-input-lazy.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -20,7 +20,6 @@ var _hoisted_1 = {
|
|
|
20
20
|
class: "flex justify-end border-b px-1 py-0.5"
|
|
21
21
|
};
|
|
22
22
|
var _hoisted_2 = ["id"];
|
|
23
|
-
var ERROR_SEVERITY = 8;
|
|
24
23
|
var monaco_json_input_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
25
24
|
__name: "monaco-json-input-lazy",
|
|
26
25
|
props: {
|
|
@@ -92,7 +91,7 @@ var monaco_json_input_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
92
91
|
if (shape.value === "string") return void 0;
|
|
93
92
|
const { parseError } = parseText(text.value, "object");
|
|
94
93
|
return parseError ? translate("chelone.validation.invalid_json", {
|
|
95
|
-
_: "Invalid JSON:
|
|
94
|
+
_: "Invalid JSON: {message}",
|
|
96
95
|
message: parseError.message
|
|
97
96
|
}) : void 0;
|
|
98
97
|
};
|
|
@@ -125,7 +124,7 @@ var monaco_json_input_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
125
124
|
const theme = useMonacoTheme();
|
|
126
125
|
const contentHeight = useAutoHeight(instance, () => props.autoHeight, props.minHeight, () => props.maxHeight);
|
|
127
126
|
const container = useMonacoLayout(instance);
|
|
128
|
-
const modelPath =
|
|
127
|
+
const modelPath = `${MODEL_PREFIX}${id.replace(/[^\w-]/g, "-")}.json`;
|
|
129
128
|
useJsonSchema(monacoApi, () => ({
|
|
130
129
|
path: modelPath,
|
|
131
130
|
schema: props.schema,
|
|
@@ -140,6 +139,7 @@ var monaco_json_input_lazy_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
140
139
|
const options = computed(() => ({
|
|
141
140
|
automaticLayout: false,
|
|
142
141
|
minimap: { enabled: false },
|
|
142
|
+
scrollBeyondLastLine: false,
|
|
143
143
|
lineNumbers: "on",
|
|
144
144
|
wordWrap: "on",
|
|
145
145
|
tabSize: 2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
|
-
import type { LooseRecord, SourceProp, SourceValue } from "@chelone/core";
|
|
2
|
+
import type { LooseRecord, ResourceRecord, SourceProp, SourceValue } from "@chelone/core";
|
|
3
3
|
/** Props for {@link RichTextField}. */
|
|
4
|
-
export interface RichTextFieldProps<RecordType extends
|
|
4
|
+
export interface RichTextFieldProps<RecordType extends ResourceRecord = LooseRecord> {
|
|
5
5
|
source: SourceProp<RecordType>;
|
|
6
6
|
record?: RecordType;
|
|
7
7
|
/** Used when the record has no value at `source`. */
|
|
@@ -14,7 +14,7 @@ export interface RichTextFieldProps<RecordType extends LooseRecord = LooseRecord
|
|
|
14
14
|
}
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
export default _default;
|
|
17
|
-
declare const __VLS_export: <RecordType extends
|
|
17
|
+
declare const __VLS_export: <RecordType extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
18
18
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<RichTextFieldProps<RecordType>> & (typeof globalThis extends {
|
|
19
19
|
__VLS_PROPS_FALLBACK: infer P;
|
|
20
20
|
} ? P : {});
|
|
@@ -64,7 +64,7 @@ var AvatarImage = defineComponent({
|
|
|
64
64
|
/** The fallback shown when no image is present (typically the name's initial). */
|
|
65
65
|
var AvatarFallback = (props, { slots }) => h("span", {
|
|
66
66
|
"data-slot": "avatar-fallback",
|
|
67
|
-
class: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm group-data-[size=sm]/avatar:text-xs", props.class)
|
|
67
|
+
class: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", props.class)
|
|
68
68
|
}, slots.default?.());
|
|
69
69
|
AvatarFallback.props = ["class"];
|
|
70
70
|
AvatarFallback.displayName = "AvatarFallback";
|
|
@@ -9,11 +9,11 @@ import { defineComponent, h } from "vue";
|
|
|
9
9
|
* classes with `cva`; here the (small, fixed) variant set is a literal map — no
|
|
10
10
|
* runtime cva dep — with the same visual contract.
|
|
11
11
|
*/
|
|
12
|
-
var BADGE_BASE = "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border
|
|
12
|
+
var BADGE_BASE = "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] [&>svg]:pointer-events-none [&>svg]:size-3";
|
|
13
13
|
var BADGE_VARIANTS = {
|
|
14
|
-
default: "bg-primary text-primary-foreground",
|
|
15
|
-
secondary: "bg-secondary text-secondary-foreground",
|
|
16
|
-
destructive: "bg-destructive text-white",
|
|
14
|
+
default: "border-transparent bg-primary text-primary-foreground",
|
|
15
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
16
|
+
destructive: "border-transparent bg-destructive text-white",
|
|
17
17
|
outline: "border-border text-foreground"
|
|
18
18
|
};
|
|
19
19
|
var Badge = defineComponent({
|