@chelone/core 0.5.0 → 0.7.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.
Files changed (253) hide show
  1. package/dist/assistant/assistant-session.d.ts +28 -0
  2. package/dist/assistant/assistant-session.js +208 -0
  3. package/dist/assistant/echo-transport.d.ts +7 -0
  4. package/dist/assistant/echo-transport.js +28 -0
  5. package/dist/assistant/http-transport.d.ts +10 -0
  6. package/dist/assistant/http-transport.js +98 -0
  7. package/dist/assistant/types.d.ts +54 -0
  8. package/dist/auth/access-control.d.ts +13 -5
  9. package/dist/auth/access-control.js +25 -21
  10. package/dist/auth/auth-options.d.ts +21 -17
  11. package/dist/auth/auth-options.js +80 -48
  12. package/dist/auth/permission-matrix.d.ts +12 -0
  13. package/dist/auth/permission-matrix.js +67 -0
  14. package/dist/auth/types.d.ts +14 -4
  15. package/dist/block-editor/block-document.d.ts +60 -0
  16. package/dist/block-editor/block-document.js +143 -0
  17. package/dist/block-editor/data-blocks.d.ts +63 -0
  18. package/dist/block-editor/data-blocks.js +117 -0
  19. package/dist/chart/chart-data.d.ts +25 -0
  20. package/dist/chart/chart-data.js +61 -0
  21. package/dist/command-menu/hotkey.js +58 -47
  22. package/dist/command-menu/recents.js +8 -11
  23. package/dist/command-menu/registry.d.ts +9 -5
  24. package/dist/command-menu/registry.js +36 -46
  25. package/dist/controller/calendar-dates.js +82 -113
  26. package/dist/controller/calendar-events.js +93 -88
  27. package/dist/controller/client-list-controller.d.ts +2 -2
  28. package/dist/controller/client-list-controller.js +251 -254
  29. package/dist/controller/data-table-columns.d.ts +2 -0
  30. package/dist/controller/data-table-columns.js +50 -56
  31. package/dist/controller/deep-equal.d.ts +1 -0
  32. package/dist/controller/deep-equal.js +14 -0
  33. package/dist/controller/filter-toggle.js +36 -44
  34. package/dist/controller/in-place-editor.d.ts +42 -0
  35. package/dist/controller/in-place-editor.js +42 -0
  36. package/dist/controller/infinite-list-controller.js +220 -190
  37. package/dist/controller/inspector.d.ts +49 -0
  38. package/dist/controller/inspector.js +64 -0
  39. package/dist/controller/job-monitor.d.ts +41 -0
  40. package/dist/controller/job-monitor.js +49 -0
  41. package/dist/controller/kanban-board.d.ts +2 -3
  42. package/dist/controller/kanban-board.js +43 -24
  43. package/dist/controller/list-controller.d.ts +5 -5
  44. package/dist/controller/list-controller.js +444 -400
  45. package/dist/controller/list-params.js +96 -87
  46. package/dist/controller/pivot-grid.d.ts +36 -0
  47. package/dist/controller/pivot-grid.js +99 -0
  48. package/dist/controller/prev-next.d.ts +2 -2
  49. package/dist/controller/prev-next.js +74 -54
  50. package/dist/controller/record-controllers.d.ts +14 -6
  51. package/dist/controller/record-controllers.js +288 -257
  52. package/dist/controller/record-diff.d.ts +21 -0
  53. package/dist/controller/record-diff.js +50 -0
  54. package/dist/controller/record-timeline.d.ts +35 -0
  55. package/dist/controller/record-timeline.js +48 -0
  56. package/dist/controller/record-tree.js +57 -47
  57. package/dist/controller/record-workflow.d.ts +38 -16
  58. package/dist/controller/record-workflow.js +85 -64
  59. package/dist/controller/reference-many-controller.js +198 -192
  60. package/dist/controller/reference-one-controller.d.ts +1 -1
  61. package/dist/controller/reference-one-controller.js +63 -56
  62. package/dist/controller/saved-queries.js +104 -91
  63. package/dist/controller/translate-fallback.js +10 -6
  64. package/dist/csv/export.d.ts +2 -1
  65. package/dist/csv/export.js +43 -40
  66. package/dist/csv/import-controller.js +185 -169
  67. package/dist/csv/match-headers.js +29 -22
  68. package/dist/csv/parse-with.js +60 -54
  69. package/dist/csv/run-import.js +69 -72
  70. package/dist/csv/validate-rows.d.ts +1 -1
  71. package/dist/csv/validate-rows.js +65 -52
  72. package/dist/data/cache-ops.d.ts +5 -4
  73. package/dist/data/cache-ops.js +208 -190
  74. package/dist/data/combine-data-providers.js +25 -23
  75. package/dist/data/data-provider-log.d.ts +45 -0
  76. package/dist/data/data-provider-log.js +93 -0
  77. package/dist/data/errors.js +14 -10
  78. package/dist/data/fake-provider.d.ts +6 -3
  79. package/dist/data/fake-provider.js +129 -114
  80. package/dist/data/fetch-utils.js +61 -44
  81. package/dist/data/filter-branch.d.ts +5 -0
  82. package/dist/data/filter-branch.js +10 -0
  83. package/dist/data/get-many-aggregate.js +84 -76
  84. package/dist/data/http-error.js +17 -12
  85. package/dist/data/keys.js +50 -36
  86. package/dist/data/mutation-options.d.ts +14 -9
  87. package/dist/data/mutation-options.js +93 -109
  88. package/dist/data/query-options.js +73 -68
  89. package/dist/data/remove-empty.d.ts +3 -0
  90. package/dist/data/remove-empty.js +11 -0
  91. package/dist/data/undoable.d.ts +2 -2
  92. package/dist/data/undoable.js +190 -174
  93. package/dist/data/with-lifecycle-callbacks.d.ts +45 -17
  94. package/dist/data/with-lifecycle-callbacks.js +66 -52
  95. package/dist/environment/application-update-store.js +58 -55
  96. package/dist/environment/offline-store.js +21 -21
  97. package/dist/form/array-binding.d.ts +30 -11
  98. package/dist/form/array-binding.js +184 -166
  99. package/dist/form/choice-ids.d.ts +7 -0
  100. package/dist/form/choice-ids.js +11 -0
  101. package/dist/form/choices-controller.d.ts +3 -2
  102. package/dist/form/choices-controller.js +302 -275
  103. package/dist/form/date-format.d.ts +38 -0
  104. package/dist/form/date-format.js +89 -0
  105. package/dist/form/dirty-values.d.ts +2 -2
  106. package/dist/form/dirty-values.js +22 -11
  107. package/dist/form/duration.d.ts +22 -0
  108. package/dist/form/duration.js +49 -0
  109. package/dist/form/edit-create-form.d.ts +12 -5
  110. package/dist/form/edit-create-form.js +243 -188
  111. package/dist/form/event-value.d.ts +6 -0
  112. package/dist/form/event-value.js +17 -0
  113. package/dist/form/field-error.d.ts +14 -0
  114. package/dist/form/field-error.js +28 -0
  115. package/dist/form/field-name.d.ts +20 -0
  116. package/dist/form/field-name.js +6 -0
  117. package/dist/form/filter-form-values.js +63 -49
  118. package/dist/form/form-controller.d.ts +9 -1
  119. package/dist/form/form-controller.js +165 -160
  120. package/dist/form/form-groups.d.ts +4 -3
  121. package/dist/form/form-groups.js +79 -79
  122. package/dist/form/form-handle.d.ts +175 -0
  123. package/dist/form/form-handle.js +68 -0
  124. package/dist/form/input-binding.d.ts +56 -31
  125. package/dist/form/input-binding.js +169 -118
  126. package/dist/form/input-values.d.ts +130 -0
  127. package/dist/form/input-values.js +177 -0
  128. package/dist/form/json-text.js +51 -37
  129. package/dist/form/save-pipeline.d.ts +6 -8
  130. package/dist/form/save-pipeline.js +91 -82
  131. package/dist/form/set-form-values.d.ts +6 -0
  132. package/dist/form/set-form-values.js +10 -0
  133. package/dist/form/source.js +97 -65
  134. package/dist/form/text-of.d.ts +2 -0
  135. package/dist/form/text-of.js +7 -0
  136. package/dist/form/validators.d.ts +58 -19
  137. package/dist/form/validators.js +97 -71
  138. package/dist/geo/bbox.d.ts +5 -4
  139. package/dist/geo/bbox.js +69 -48
  140. package/dist/geo/bounds.d.ts +14 -3
  141. package/dist/geo/bounds.js +98 -68
  142. package/dist/geo/constraints.js +88 -93
  143. package/dist/geo/coordinates.js +31 -23
  144. package/dist/geo/editor.d.ts +13 -13
  145. package/dist/geo/editor.js +176 -153
  146. package/dist/geo/geocoding.d.ts +4 -4
  147. package/dist/geo/geocoding.js +38 -41
  148. package/dist/geo/geojson.d.ts +12 -74
  149. package/dist/geo/geojson.js +52 -40
  150. package/dist/geo/geometry-math.d.ts +4 -4
  151. package/dist/geo/geometry-math.js +100 -93
  152. package/dist/geo/index.d.ts +7 -6
  153. package/dist/geo/map-layers.d.ts +42 -7
  154. package/dist/geo/map-layers.js +88 -62
  155. package/dist/geo/map-style.js +31 -32
  156. package/dist/geo/messages.js +48 -45
  157. package/dist/geo/nominatim.js +88 -80
  158. package/dist/geo/osm-presets.d.ts +4 -3
  159. package/dist/geo/osm-presets.js +108 -86
  160. package/dist/geo/osm-tags.js +14 -12
  161. package/dist/geo/overpass.d.ts +14 -2
  162. package/dist/geo/overpass.js +83 -90
  163. package/dist/geo/shape-value.d.ts +9 -5
  164. package/dist/geo/shape-value.js +169 -146
  165. package/dist/geo/snap-to-roads.d.ts +3 -3
  166. package/dist/geo/snap-to-roads.js +55 -50
  167. package/dist/geo/throttle.js +36 -39
  168. package/dist/guards.d.ts +37 -0
  169. package/dist/guards.js +62 -0
  170. package/dist/i18n/default-messages.js +34 -29
  171. package/dist/i18n/english-messages.js +187 -189
  172. package/dist/i18n/i18n.d.ts +8 -2
  173. package/dist/i18n/i18n.js +47 -48
  174. package/dist/i18n/inflection.d.ts +34 -0
  175. package/dist/i18n/inflection.js +82 -0
  176. package/dist/i18n/messages.d.ts +10 -2
  177. package/dist/i18n/messages.js +17 -4
  178. package/dist/i18n/missing-keys.d.ts +19 -0
  179. package/dist/i18n/missing-keys.js +68 -0
  180. package/dist/i18n/translatable.d.ts +16 -1
  181. package/dist/i18n/translatable.js +40 -47
  182. package/dist/index.d.ts +96 -22
  183. package/dist/index.js +52 -257
  184. package/dist/json/deep-equal.d.ts +8 -0
  185. package/dist/json/deep-equal.js +24 -0
  186. package/dist/json/strip-json-comments.js +38 -42
  187. package/dist/noop.d.ts +2 -0
  188. package/dist/noop.js +4 -0
  189. package/dist/notification/error-message.d.ts +2 -0
  190. package/dist/notification/error-message.js +10 -0
  191. package/dist/notification/notification-store.d.ts +3 -2
  192. package/dist/notification/notification-store.js +41 -45
  193. package/dist/onboarding-tour/placement.d.ts +34 -0
  194. package/dist/onboarding-tour/placement.js +67 -0
  195. package/dist/onboarding-tour/tour-controller.d.ts +25 -0
  196. package/dist/onboarding-tour/tour-controller.js +50 -0
  197. package/dist/realtime/add-events-for-mutations.js +75 -81
  198. package/dist/realtime/announce-lock.d.ts +7 -0
  199. package/dist/realtime/announce-lock.js +18 -0
  200. package/dist/realtime/broadcast-channel-transport.d.ts +14 -0
  201. package/dist/realtime/broadcast-channel-transport.js +69 -0
  202. package/dist/realtime/copy-members.js +22 -14
  203. package/dist/realtime/in-memory-lock-provider.js +41 -60
  204. package/dist/realtime/live.js +95 -101
  205. package/dist/realtime/lock-options.js +16 -16
  206. package/dist/realtime/lock-session.js +91 -78
  207. package/dist/realtime/memory-transport.js +26 -67
  208. package/dist/realtime/presence.js +120 -122
  209. package/dist/realtime/realtime-data-provider.d.ts +10 -0
  210. package/dist/realtime/realtime-data-provider.js +45 -42
  211. package/dist/realtime/reconnect-backoff.d.ts +15 -0
  212. package/dist/realtime/reconnect-backoff.js +17 -0
  213. package/dist/realtime/sse-transport.d.ts +31 -0
  214. package/dist/realtime/sse-transport.js +235 -0
  215. package/dist/realtime/status-store.js +23 -28
  216. package/dist/realtime/topic-hub.d.ts +24 -0
  217. package/dist/realtime/topic-hub.js +66 -0
  218. package/dist/realtime/topics.js +10 -12
  219. package/dist/realtime/types.js +10 -12
  220. package/dist/realtime/unread-count.js +21 -21
  221. package/dist/realtime/websocket-transport.d.ts +32 -0
  222. package/dist/realtime/websocket-transport.js +306 -0
  223. package/dist/resource/describe-resource.d.ts +2 -0
  224. package/dist/resource/describe-resource.js +232 -219
  225. package/dist/resource/get-at-path.js +29 -14
  226. package/dist/resource/identifier.d.ts +18 -0
  227. package/dist/resource/identifier.js +27 -0
  228. package/dist/resource/record.d.ts +4 -0
  229. package/dist/resource/record.js +10 -0
  230. package/dist/resource/register.d.ts +7 -0
  231. package/dist/resource/registry-store.d.ts +45 -15
  232. package/dist/resource/registry-store.js +67 -60
  233. package/dist/resource/registry.d.ts +10 -0
  234. package/dist/resource/registry.js +8 -4
  235. package/dist/resource/source-path.d.ts +16 -1
  236. package/dist/rich-text/rich-text-extras.d.ts +132 -0
  237. package/dist/rich-text/rich-text-extras.js +179 -0
  238. package/dist/rich-text/rich-text-image.d.ts +124 -0
  239. package/dist/rich-text/rich-text-image.js +163 -0
  240. package/dist/rich-text/rich-text.d.ts +62 -0
  241. package/dist/rich-text/rich-text.js +142 -0
  242. package/dist/router/location.d.ts +22 -4
  243. package/dist/router/location.js +41 -18
  244. package/dist/router/match.js +47 -39
  245. package/dist/router/paths.js +40 -34
  246. package/dist/router/record-from-location.d.ts +1 -1
  247. package/dist/router/record-from-location.js +25 -17
  248. package/dist/store/adapters.js +51 -55
  249. package/dist/store/micro-store.js +57 -59
  250. package/dist/store/shallow-equal.d.ts +12 -0
  251. package/dist/store/shallow-equal.js +20 -0
  252. package/dist/store/store.js +54 -57
  253. package/package.json +13 -11
package/dist/index.js CHANGED
@@ -1,22 +1,34 @@
1
- import { revalidateLogic } from "@tanstack/form-core";
1
+ import { createAssistantSession } from "./assistant/assistant-session.js";
2
+ import { echoAssistantTransport } from "./assistant/echo-transport.js";
3
+ import { httpAssistantTransport } from "./assistant/http-transport.js";
2
4
  import { canAccessWithPermissions } from "./auth/access-control.js";
3
5
  import { authStateQueryOptions, canAccessQueryOptions, checkError, identityQueryOptions, permissionsQueryOptions } from "./auth/auth-options.js";
6
+ import { getPermissionCell, isPermissionRowGranted, setPermissionRow, togglePermission } from "./auth/permission-matrix.js";
7
+ import { createBlockRegistry, describeBlockAttrs, emptyBlockDocument, getBlockDefaultAttrs, isBlockDoc, isEmptyBlockDocument, matchBlocks, toEmbedSrc, unknownBlockType, unwrapUnknownBlocks, wrapUnknownBlocks } from "./block-editor/block-document.js";
8
+ import { aggregateChartData, chartBlockSpec, dataBlockNames, formatDataBlockValue, pickDataBlockFields, readDataBlockValue, recordListBlockSpec, referenceRecordBlockSpec } from "./block-editor/data-blocks.js";
9
+ import { DEFAULT_CHART_COLORS, chartColor, getMetricDelta, hasChartValues, toCartesianRows, toDonutSlices } from "./chart/chart-data.js";
4
10
  import { isTypingTarget, matchesHotkey, shouldHandleHotkey } from "./command-menu/hotkey.js";
5
11
  import { recentsKey, rememberRecent } from "./command-menu/recents.js";
6
12
  import { createCommandRegistry, getVisibleCommands, groupCommands } from "./command-menu/registry.js";
7
13
  import { calendarDayKey, calendarDays, calendarLabels, calendarRange, parseCalendarDate, shiftCalendarAnchor } from "./controller/calendar-dates.js";
8
14
  import { calendarEventsInHour, calendarEventsOnDay, calendarRangeFilter, groupCalendarAgenda, moveCalendarEvent, omitCalendarRangeFilter, staleCalendarRangeKeys, toCalendarEvents } from "./controller/calendar-events.js";
9
15
  import { createClientListController } from "./controller/client-list-controller.js";
10
- import { arrangeColumns, columnLabelMatches, dataTableColumnKeys, defaultDataTableStoreKey, getDataTableColumnId, moveColumn, toggleHiddenColumn } from "./controller/data-table-columns.js";
16
+ import { arrangeColumns, columnLabelMatches, dataTableColumnKeys, defaultDataTableStoreKey, getDataTableColumnId, moveColumn, moveColumnTo, toggleHiddenColumn } from "./controller/data-table-columns.js";
11
17
  import { isFilterSelected, toggleFilterValue } from "./controller/filter-toggle.js";
18
+ import { nextInPlaceEditorState, planInPlaceSave } from "./controller/in-place-editor.js";
12
19
  import { createInfiniteListController } from "./controller/infinite-list-controller.js";
20
+ import { clampInspectorPosition, configurableInputColumns, createInspector, defaultConfigurableInputsStoreKey, inspectorPositionKey } from "./controller/inspector.js";
21
+ import { DEFAULT_JOB_TABS, getJobActions, planJobCancel, planJobRetry } from "./controller/job-monitor.js";
13
22
  import { buildKanbanBuckets, planKanbanMove } from "./controller/kanban-board.js";
14
23
  import { createListController, listControllerActions } from "./controller/list-controller.js";
15
24
  import { hasCustomParams, listPatchFromSearch, parseListParams, serializeListParams, serializeListState } from "./controller/list-params.js";
25
+ import { buildPivotTable, formatPivotValue } from "./controller/pivot-grid.js";
16
26
  import { canUseCachedPage, getPrevNextParams, resolvePrevNext } from "./controller/prev-next.js";
17
27
  import { createCreateController, createDeleteController, createEditController, createShowController } from "./controller/record-controllers.js";
28
+ import { diffRecords, formatDiffValue } from "./controller/record-diff.js";
29
+ import { formatRelativeTime, toTimelineEntries } from "./controller/record-timeline.js";
18
30
  import { buildRecordTree } from "./controller/record-tree.js";
19
- import { buildApprovalUpdate, getAllowedTransitions, getApprovalState } from "./controller/record-workflow.js";
31
+ import { buildApprovalUpdate, buildRejectionUpdate, getAllowedTransitions, getApprovalState } from "./controller/record-workflow.js";
20
32
  import { createReferenceManyController } from "./controller/reference-many-controller.js";
21
33
  import { createReferenceOneController } from "./controller/reference-one-controller.js";
22
34
  import { createSavedQueriesController, extractValidSavedQueries, isSavedQueryActive, savedQueriesKey } from "./controller/saved-queries.js";
@@ -29,9 +41,11 @@ import { csvErrorRows, runCsvImport } from "./csv/run-import.js";
29
41
  import { applyCsvMapping, csvSchemaFields, validateCsvRows } from "./csv/validate-rows.js";
30
42
  import { removeRecordsFromCache, updateRecordsInCache } from "./data/cache-ops.js";
31
43
  import { combineDataProviders } from "./data/combine-data-providers.js";
44
+ import { createDataProviderLog } from "./data/data-provider-log.js";
32
45
  import { ValidationError } from "./data/errors.js";
33
46
  import { fakeDataProvider } from "./data/fake-provider.js";
34
47
  import { fetchUtils } from "./data/fetch-utils.js";
48
+ import { isFilterBranch } from "./data/filter-branch.js";
35
49
  import { getManyAggregateOptions } from "./data/get-many-aggregate.js";
36
50
  import { HttpError } from "./data/http-error.js";
37
51
  import { infiniteListKey, listKey, lockKey, locksKey, manyKey, manyReferenceKey, oneKey, resourceKey } from "./data/keys.js";
@@ -42,15 +56,24 @@ import { withLifecycleCallbacks } from "./data/with-lifecycle-callbacks.js";
42
56
  import { createApplicationUpdateStore } from "./environment/application-update-store.js";
43
57
  import { createOfflineStore } from "./environment/offline-store.js";
44
58
  import { createArrayBinding } from "./form/array-binding.js";
59
+ import { toIdentifierList } from "./form/choice-ids.js";
45
60
  import { createChoicesController } from "./form/choices-controller.js";
61
+ import { formatDate, formatDateTime, formatTime, isValidDate, isValidDateTime, isValidTime, parseDateTimeToISO, parseTimeToDate } from "./form/date-format.js";
46
62
  import { getDirtyFormValues } from "./form/dirty-values.js";
63
+ import { compactDuration, parseIsoDuration, relativeDuration } from "./form/duration.js";
47
64
  import { createCreateFormController, createEditFormController } from "./form/edit-create-form.js";
65
+ import { extractEventValue } from "./form/event-value.js";
66
+ import { firstFieldError } from "./form/field-error.js";
48
67
  import { filterFormReflectShape, getFilterFormValues, mergeFilterValues } from "./form/filter-form-values.js";
49
68
  import { createFormController, normalizeFormError } from "./form/form-controller.js";
50
69
  import { createFormGroups, reduceGroupState } from "./form/form-groups.js";
70
+ import { createFormHandle, isResourceHandle, toFormContextHandle, toResourceFormHandle } from "./form/form-handle.js";
51
71
  import { createFieldBinding, defaultFormat, defaultParse } from "./form/input-binding.js";
72
+ import { choiceIdOf, fileEntryKey, fileEntryPreview, isTransformedFile, resolveChoiceValue, toBooleanValue, toChoiceValue, toChoiceValues, toCurrencyComposite, toCurrencyValue, toDateInputValue, toFileEntries, toFileInputValue, toFileSelection, toNullableBooleanValue, toNumberValue, toTextList, toTextValue, toWebhookValue } from "./form/input-values.js";
52
73
  import { detectJsonShape, formatJsonValue, fromJsonText, toJsonText } from "./form/json-text.js";
74
+ import { setFormValues } from "./form/set-form-values.js";
53
75
  import { composeSource, createArraySourceScope, createLocaleSourceScope, createRowSourceScope, rootSourceScope } from "./form/source.js";
76
+ import { textOf } from "./form/text-of.js";
54
77
  import { choices, composeValidators, email, isEmpty, isRequired, maxLength, maxValue, minLength, minValue, number, regex, required } from "./form/validators.js";
55
78
  import { aspectLockedBBox, bboxToPolygon, polygonToBBox } from "./geo/bbox.js";
56
79
  import { geoBounds, isLngLatBox } from "./geo/bounds.js";
@@ -58,7 +81,7 @@ import { countVertices, maxVertices, minAreaM2, minVertices, noSelfIntersection
58
81
  import { latitude, longitude, toCoordinate } from "./geo/coordinates.js";
59
82
  import { editorStyles, fromEditorFeatures, toEditorFeatures } from "./geo/editor.js";
60
83
  import { geocodeQueryOptions, reverseGeocodeQueryOptions } from "./geo/geocoding.js";
61
- import { isGeoBBox, isGeoFeature, isGeoFeatureCollection, isGeoGeometry, isGeoJsonValue } from "./geo/geojson.js";
84
+ import { isGeoArea, isGeoBBox, isGeoFeature, isGeoFeatureCollection, isGeoGeometry, isGeoJsonValue, placedFeatures } from "./geo/geojson.js";
62
85
  import { areaInTypeOf, geoAreaM2, hasSelfIntersection } from "./geo/geometry-math.js";
63
86
  import { DEFAULT_SHAPE_STYLE, asFeatureCollection, shapeLayerSpecs } from "./geo/map-layers.js";
64
87
  import { expandTileUrl, latLngToLngLat, lngLatToLatLng, rasterTileStyle } from "./geo/map-style.js";
@@ -66,285 +89,57 @@ import { mapMessages } from "./geo/messages.js";
66
89
  import { createNominatimProvider } from "./geo/nominatim.js";
67
90
  import { OSM_PRESETS, buildOverpassQuery, findPresetForTags } from "./geo/osm-presets.js";
68
91
  import { tagToFilter } from "./geo/osm-tags.js";
69
- import { OverpassError, OverpassRateLimitError, OverpassTimeoutError, createOverpassProvider, overpassQueryOptions } from "./geo/overpass.js";
92
+ import { OverpassError, OverpassRateLimitError, OverpassTimeoutError, createOverpassProvider, isOverpassAnswer, overpassQueryOptions } from "./geo/overpass.js";
70
93
  import { featuresToShape, heldFeatures, shapeToFeatures } from "./geo/shape-value.js";
71
94
  import { createOsrmProvider } from "./geo/snap-to-roads.js";
95
+ import { isRecord, isThenable } from "./guards.js";
72
96
  import { defaultMessages } from "./i18n/default-messages.js";
73
97
  import { englishMessages } from "./i18n/english-messages.js";
74
98
  import { createI18n } from "./i18n/i18n.js";
75
- import { defineMessages } from "./i18n/messages.js";
99
+ import { humanize, humanizeField, pluralize } from "./i18n/inflection.js";
100
+ import { defineMessages, definedParams, pickTranslateParamValues } from "./i18n/messages.js";
101
+ import { createMissingKeyStore } from "./i18n/missing-keys.js";
76
102
  import { createTranslatableController, getRecordForLocale } from "./i18n/translatable.js";
103
+ import { deepEqual } from "./json/deep-equal.js";
77
104
  import { stripJsonComments } from "./json/strip-json-comments.js";
105
+ import { noop } from "./noop.js";
106
+ import { errorMessageOf } from "./notification/error-message.js";
78
107
  import { createNotificationStore } from "./notification/notification-store.js";
108
+ import { placeTourCard, tourSpotlightPath } from "./onboarding-tour/placement.js";
109
+ import { createTourController, onboardingTourKey } from "./onboarding-tour/tour-controller.js";
79
110
  import { addEventsForMutations } from "./realtime/add-events-for-mutations.js";
111
+ import { announceLock } from "./realtime/announce-lock.js";
112
+ import { broadcastChannelTransport } from "./realtime/broadcast-channel-transport.js";
80
113
  import { inMemoryLockProvider } from "./realtime/in-memory-lock-provider.js";
81
114
  import { subscribeLiveLock, subscribeLiveLocks, subscribeLiveRecord, subscribeLiveRecords, subscribeLiveResource } from "./realtime/live.js";
82
115
  import { getLockOptions, getLocksOptions } from "./realtime/lock-options.js";
83
116
  import { createLockSession, resolveLockIdentity } from "./realtime/lock-session.js";
84
117
  import { memoryTransport } from "./realtime/memory-transport.js";
85
118
  import { createPresenceSession, getPresenceInitials, toPresenceUser } from "./realtime/presence.js";
86
- import { assertRealtimeDataProvider, isRealtimeDataProvider, realtimeDataProvider } from "./realtime/realtime-data-provider.js";
119
+ import { assertRealtimeDataProvider, hasTransportMembers, isRealtimeDataProvider, realtimeDataProvider } from "./realtime/realtime-data-provider.js";
120
+ import { sseTransport } from "./realtime/sse-transport.js";
87
121
  import { createRealtimeStatusStore } from "./realtime/status-store.js";
122
+ import { createTopicHub } from "./realtime/topic-hub.js";
88
123
  import { lockResourceTopic, lockTopic, presenceTopic, recordTopic, resourceTopic } from "./realtime/topics.js";
89
124
  import { LockConflictError } from "./realtime/types.js";
90
125
  import { clearUnread, subscribeUnreadCount, unreadKey } from "./realtime/unread-count.js";
126
+ import { webSocketTransport } from "./realtime/websocket-transport.js";
91
127
  import { describeResource } from "./resource/describe-resource.js";
92
128
  import { getAtPath } from "./resource/get-at-path.js";
129
+ import { identifiersOf, isIdentifier, isIdentifierArray } from "./resource/identifier.js";
130
+ import { isLooseRecord, isResourceRecord } from "./resource/record.js";
93
131
  import { defineResources } from "./resource/registry.js";
94
132
  import { computeDefinition, createResourceRegistry } from "./resource/registry-store.js";
95
- import { parseLocation } from "./router/location.js";
133
+ import { isSafeFileUrl, isSafeImageSrc, isSafeLinkUrl, richTextBlockTypes, richTextSanitizeOptions, richTextStarterKitOptions, richTextToolbarItems } from "./rich-text/rich-text.js";
134
+ import { checkRichTextImageFile, clampRichTextImageWidth, defaultRichTextImageRules, endColorOnEnter, normalizeRichTextUpload, richTextCodeBlockOptions, richTextColors, richTextExtraToolbarItems, richTextImageActions, richTextImageFileName, richTextStyledSanitizeOptions, sanitizeRichTextStyle } from "./rich-text/rich-text-extras.js";
135
+ import { copyRichTextImage, downloadRichTextImage, isRichTextImageConfigSource, prepareRichTextImages, resolveRichTextImageConfig, richTextImageAttributes, richTextImageUploadState, sanitizeRichTextImageElement, setRichTextImageUploading, storeRichTextImageFile } from "./rich-text/rich-text-image.js";
136
+ import { parseLocation, toLocationState } from "./router/location.js";
96
137
  import { matchPath } from "./router/match.js";
97
138
  import { createPath, joinBasename, removeDoubleSlashes } from "./router/paths.js";
98
139
  import { getRecordFromLocation } from "./router/record-from-location.js";
99
140
  import { localStorageAdapter, memoryStoreAdapter } from "./store/adapters.js";
100
141
  import { createMicroStore } from "./store/micro-store.js";
142
+ import { shallowEqual } from "./store/shallow-equal.js";
101
143
  import { createStore } from "./store/store.js";
102
- export {
103
- DEFAULT_SHAPE_STYLE,
104
- HttpError,
105
- LockConflictError,
106
- OSM_PRESETS,
107
- OverpassError,
108
- OverpassRateLimitError,
109
- OverpassTimeoutError,
110
- ValidationError,
111
- addEventsForMutations,
112
- applyCsvMapping,
113
- areaInTypeOf,
114
- arrangeColumns,
115
- asFeatureCollection,
116
- aspectLockedBBox,
117
- assertRealtimeDataProvider,
118
- authStateQueryOptions,
119
- bboxToPolygon,
120
- buildApprovalUpdate,
121
- buildKanbanBuckets,
122
- buildOverpassQuery,
123
- buildRecordTree,
124
- calendarDayKey,
125
- calendarDays,
126
- calendarEventsInHour,
127
- calendarEventsOnDay,
128
- calendarLabels,
129
- calendarRange,
130
- calendarRangeFilter,
131
- canAccessQueryOptions,
132
- canAccessWithPermissions,
133
- canUseCachedPage,
134
- checkError,
135
- choices,
136
- clearUnread,
137
- columnLabelMatches,
138
- combineDataProviders,
139
- commitAllUndoables,
140
- composeSource,
141
- composeValidators,
142
- computeDefinition,
143
- countVertices,
144
- createApplicationUpdateStore,
145
- createArrayBinding,
146
- createArraySourceScope,
147
- createChoicesController,
148
- createClientListController,
149
- createCommandRegistry,
150
- createCreateController,
151
- createCreateFormController,
152
- createCsvImportController,
153
- createDeleteController,
154
- createEditController,
155
- createEditFormController,
156
- createFieldBinding,
157
- createFormController,
158
- createFormGroups,
159
- createI18n,
160
- createInfiniteListController,
161
- createListController,
162
- createLocaleSourceScope,
163
- createLockSession,
164
- createMicroStore,
165
- createMutationOptions,
166
- createNominatimProvider,
167
- createNotificationStore,
168
- createOfflineStore,
169
- createOsrmProvider,
170
- createOverpassProvider,
171
- createPath,
172
- createPresenceSession,
173
- createRealtimeStatusStore,
174
- createReferenceManyController,
175
- createReferenceOneController,
176
- createResourceRegistry,
177
- createRowSourceScope,
178
- createSavedQueriesController,
179
- createShowController,
180
- createStore,
181
- createTranslatableController,
182
- csvErrorRows,
183
- csvSchemaFields,
184
- dataTableColumnKeys,
185
- defaultDataTableStoreKey,
186
- defaultExporter,
187
- defaultFormat,
188
- defaultMessages,
189
- defaultParse,
190
- defineMessages,
191
- defineResources,
192
- deleteMutationOptions,
193
- describeResource,
194
- detectJsonShape,
195
- downloadCSV,
196
- editorStyles,
197
- email,
198
- englishMessages,
199
- expandTileUrl,
200
- extractValidSavedQueries,
201
- fakeDataProvider,
202
- featuresToShape,
203
- fetchUtils,
204
- filterFormReflectShape,
205
- findPresetForTags,
206
- formatJsonValue,
207
- fromEditorFeatures,
208
- fromJsonText,
209
- geoAreaM2,
210
- geoBounds,
211
- geocodeQueryOptions,
212
- getAllowedTransitions,
213
- getApprovalState,
214
- getAtPath,
215
- getDataTableColumnId,
216
- getDirtyFormValues,
217
- getFilterFormValues,
218
- getInfiniteListOptions,
219
- getListOptions,
220
- getLockOptions,
221
- getLocksOptions,
222
- getManyAggregateOptions,
223
- getManyOptions,
224
- getManyReferenceOptions,
225
- getOneOptions,
226
- getPresenceInitials,
227
- getPrevNextParams,
228
- getRecordForLocale,
229
- getRecordFromLocation,
230
- getVisibleCommands,
231
- groupCalendarAgenda,
232
- groupCommands,
233
- hasCustomParams,
234
- hasPendingUndoables,
235
- hasSelfIntersection,
236
- heldFeatures,
237
- identityQueryOptions,
238
- inMemoryLockProvider,
239
- infiniteListKey,
240
- isEmpty,
241
- isFilterSelected,
242
- isGeoBBox,
243
- isGeoFeature,
244
- isGeoFeatureCollection,
245
- isGeoGeometry,
246
- isGeoJsonValue,
247
- isLngLatBox,
248
- isRealtimeDataProvider,
249
- isRequired,
250
- isSavedQueryActive,
251
- isTypingTarget,
252
- joinBasename,
253
- latLngToLngLat,
254
- latitude,
255
- listControllerActions,
256
- listKey,
257
- listPatchFromSearch,
258
- lngLatToLatLng,
259
- localStorageAdapter,
260
- lockKey,
261
- lockResourceTopic,
262
- lockTopic,
263
- locksKey,
264
- longitude,
265
- manyKey,
266
- manyReferenceKey,
267
- mapMessages,
268
- matchCsvHeaders,
269
- matchPath,
270
- matchesHotkey,
271
- maxLength,
272
- maxValue,
273
- maxVertices,
274
- memoryStoreAdapter,
275
- memoryTransport,
276
- mergeFilterValues,
277
- minAreaM2,
278
- minLength,
279
- minValue,
280
- minVertices,
281
- moveCalendarEvent,
282
- moveColumn,
283
- noSelfIntersection,
284
- normalizeFormError,
285
- number,
286
- omitCalendarRangeFilter,
287
- oneKey,
288
- overpassQueryOptions,
289
- parseCalendarDate,
290
- parseCsvWith,
291
- parseListParams,
292
- parseLocation,
293
- patchedRecord,
294
- permissionsQueryOptions,
295
- planKanbanMove,
296
- polygonToBBox,
297
- presenceTopic,
298
- rasterTileStyle,
299
- realtimeDataProvider,
300
- recentsKey,
301
- recordTopic,
302
- recordsToCSV,
303
- reduceGroupState,
304
- regex,
305
- rememberRecent,
306
- removeDoubleSlashes,
307
- removeRecordsFromCache,
308
- required,
309
- resolveLockIdentity,
310
- resolveNotificationKey,
311
- resolvePrevNext,
312
- resourceKey,
313
- resourceTopic,
314
- revalidateLogic,
315
- reverseGeocodeQueryOptions,
316
- rootSourceScope,
317
- runCsvImport,
318
- savedQueriesKey,
319
- serializeListParams,
320
- serializeListState,
321
- shapeLayerSpecs,
322
- shapeToFeatures,
323
- shiftCalendarAnchor,
324
- shouldHandleHotkey,
325
- staleCalendarRangeKeys,
326
- startUndoableMutation,
327
- stripJsonComments,
328
- subscribeLiveLock,
329
- subscribeLiveLocks,
330
- subscribeLiveRecord,
331
- subscribeLiveRecords,
332
- subscribeLiveResource,
333
- subscribeUnreadCount,
334
- tagToFilter,
335
- toCalendarEvents,
336
- toCoordinate,
337
- toEditorFeatures,
338
- toJsonText,
339
- toPresenceUser,
340
- toggleFilterValue,
341
- toggleHiddenColumn,
342
- undoableCallbacks,
343
- undoableDeleteOptions,
344
- undoableUpdateOptions,
345
- unreadKey,
346
- updateMutationOptions,
347
- updateRecordsInCache,
348
- validateCsvRows,
349
- withLifecycleCallbacks
350
- };
144
+ import { revalidateLogic } from "@tanstack/form-core";
145
+ export { DEFAULT_CHART_COLORS, DEFAULT_JOB_TABS, DEFAULT_SHAPE_STYLE, HttpError, LockConflictError, OSM_PRESETS, OverpassError, OverpassRateLimitError, OverpassTimeoutError, ValidationError, addEventsForMutations, aggregateChartData, announceLock, applyCsvMapping, areaInTypeOf, arrangeColumns, asFeatureCollection, aspectLockedBBox, assertRealtimeDataProvider, authStateQueryOptions, bboxToPolygon, broadcastChannelTransport, buildApprovalUpdate, buildKanbanBuckets, buildOverpassQuery, buildPivotTable, buildRecordTree, buildRejectionUpdate, calendarDayKey, calendarDays, calendarEventsInHour, calendarEventsOnDay, calendarLabels, calendarRange, calendarRangeFilter, canAccessQueryOptions, canAccessWithPermissions, canUseCachedPage, chartBlockSpec, chartColor, checkError, checkRichTextImageFile, choiceIdOf, choices, clampInspectorPosition, clampRichTextImageWidth, clearUnread, columnLabelMatches, combineDataProviders, commitAllUndoables, compactDuration, composeSource, composeValidators, computeDefinition, configurableInputColumns, copyRichTextImage, countVertices, createApplicationUpdateStore, createArrayBinding, createArraySourceScope, createAssistantSession, createBlockRegistry, createChoicesController, createClientListController, createCommandRegistry, createCreateController, createCreateFormController, createCsvImportController, createDataProviderLog, createDeleteController, createEditController, createEditFormController, createFieldBinding, createFormController, createFormGroups, createFormHandle, createI18n, createInfiniteListController, createInspector, createListController, createLocaleSourceScope, createLockSession, createMicroStore, createMissingKeyStore, createMutationOptions, createNominatimProvider, createNotificationStore, createOfflineStore, createOsrmProvider, createOverpassProvider, createPath, createPresenceSession, createRealtimeStatusStore, createReferenceManyController, createReferenceOneController, createResourceRegistry, createRowSourceScope, createSavedQueriesController, createShowController, createStore, createTopicHub, createTourController, createTranslatableController, csvErrorRows, csvSchemaFields, dataBlockNames, dataTableColumnKeys, deepEqual, defaultConfigurableInputsStoreKey, defaultDataTableStoreKey, defaultExporter, defaultFormat, defaultMessages, defaultParse, defaultRichTextImageRules, defineMessages, defineResources, definedParams, deleteMutationOptions, describeBlockAttrs, describeResource, detectJsonShape, diffRecords, downloadCSV, downloadRichTextImage, echoAssistantTransport, editorStyles, email, emptyBlockDocument, endColorOnEnter, englishMessages, errorMessageOf, expandTileUrl, extractEventValue, extractValidSavedQueries, fakeDataProvider, featuresToShape, fetchUtils, fileEntryKey, fileEntryPreview, filterFormReflectShape, findPresetForTags, firstFieldError, formatDataBlockValue, formatDate, formatDateTime, formatDiffValue, formatJsonValue, formatPivotValue, formatRelativeTime, formatTime, fromEditorFeatures, fromJsonText, geoAreaM2, geoBounds, geocodeQueryOptions, getAllowedTransitions, getApprovalState, getAtPath, getBlockDefaultAttrs, getDataTableColumnId, getDirtyFormValues, getFilterFormValues, getInfiniteListOptions, getJobActions, getListOptions, getLockOptions, getLocksOptions, getManyAggregateOptions, getManyOptions, getManyReferenceOptions, getMetricDelta, getOneOptions, getPermissionCell, getPresenceInitials, getPrevNextParams, getRecordForLocale, getRecordFromLocation, getVisibleCommands, groupCalendarAgenda, groupCommands, hasChartValues, hasCustomParams, hasPendingUndoables, hasSelfIntersection, hasTransportMembers, heldFeatures, httpAssistantTransport, humanize, humanizeField, identifiersOf, identityQueryOptions, inMemoryLockProvider, infiniteListKey, inspectorPositionKey, isBlockDoc, isEmpty, isEmptyBlockDocument, isFilterBranch, isFilterSelected, isGeoArea, isGeoBBox, isGeoFeature, isGeoFeatureCollection, isGeoGeometry, isGeoJsonValue, isIdentifier, isIdentifierArray, isLngLatBox, isLooseRecord, isOverpassAnswer, isPermissionRowGranted, isRealtimeDataProvider, isRecord, isRequired, isResourceHandle, isResourceRecord, isRichTextImageConfigSource, isSafeFileUrl, isSafeImageSrc, isSafeLinkUrl, isSavedQueryActive, isThenable, isTransformedFile, isTypingTarget, isValidDate, isValidDateTime, isValidTime, joinBasename, latLngToLngLat, latitude, listControllerActions, listKey, listPatchFromSearch, lngLatToLatLng, localStorageAdapter, lockKey, lockResourceTopic, lockTopic, locksKey, longitude, manyKey, manyReferenceKey, mapMessages, matchBlocks, matchCsvHeaders, matchPath, matchesHotkey, maxLength, maxValue, maxVertices, memoryStoreAdapter, memoryTransport, mergeFilterValues, minAreaM2, minLength, minValue, minVertices, moveCalendarEvent, moveColumn, moveColumnTo, nextInPlaceEditorState, noSelfIntersection, noop, normalizeFormError, normalizeRichTextUpload, number, omitCalendarRangeFilter, onboardingTourKey, oneKey, overpassQueryOptions, parseCalendarDate, parseCsvWith, parseDateTimeToISO, parseIsoDuration, parseListParams, parseLocation, parseTimeToDate, patchedRecord, permissionsQueryOptions, pickDataBlockFields, pickTranslateParamValues, placeTourCard, placedFeatures, planInPlaceSave, planJobCancel, planJobRetry, planKanbanMove, pluralize, polygonToBBox, prepareRichTextImages, presenceTopic, rasterTileStyle, readDataBlockValue, realtimeDataProvider, recentsKey, recordListBlockSpec, recordTopic, recordsToCSV, reduceGroupState, referenceRecordBlockSpec, regex, relativeDuration, rememberRecent, removeDoubleSlashes, removeRecordsFromCache, required, resolveChoiceValue, resolveLockIdentity, resolveNotificationKey, resolvePrevNext, resolveRichTextImageConfig, resourceKey, resourceTopic, revalidateLogic, reverseGeocodeQueryOptions, richTextBlockTypes, richTextCodeBlockOptions, richTextColors, richTextExtraToolbarItems, richTextImageActions, richTextImageAttributes, richTextImageFileName, richTextImageUploadState, richTextSanitizeOptions, richTextStarterKitOptions, richTextStyledSanitizeOptions, richTextToolbarItems, rootSourceScope, runCsvImport, sanitizeRichTextImageElement, sanitizeRichTextStyle, savedQueriesKey, serializeListParams, serializeListState, setFormValues, setPermissionRow, setRichTextImageUploading, shallowEqual, shapeLayerSpecs, shapeToFeatures, shiftCalendarAnchor, shouldHandleHotkey, sseTransport, staleCalendarRangeKeys, startUndoableMutation, storeRichTextImageFile, stripJsonComments, subscribeLiveLock, subscribeLiveLocks, subscribeLiveRecord, subscribeLiveRecords, subscribeLiveResource, subscribeUnreadCount, tagToFilter, textOf, toBooleanValue, toCalendarEvents, toCartesianRows, toChoiceValue, toChoiceValues, toCoordinate, toCurrencyComposite, toCurrencyValue, toDateInputValue, toDonutSlices, toEditorFeatures, toEmbedSrc, toFileEntries, toFileInputValue, toFileSelection, toFormContextHandle, toIdentifierList, toJsonText, toLocationState, toNullableBooleanValue, toNumberValue, toPresenceUser, toResourceFormHandle, toTextList, toTextValue, toTimelineEntries, toWebhookValue, toggleFilterValue, toggleHiddenColumn, togglePermission, tourSpotlightPath, undoableCallbacks, undoableDeleteOptions, undoableUpdateOptions, unknownBlockType, unreadKey, unwrapUnknownBlocks, updateMutationOptions, updateRecordsInCache, validateCsvRows, webSocketTransport, withLifecycleCallbacks, wrapUnknownBlocks };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Are `a` and `b` the same value? `===` answers for anything that is the same
3
+ * value; arrays compare by order and length; plain objects compare by content
4
+ * whatever order their keys were written in. A key whose value is `undefined`
5
+ * counts as absent, the way `JSON.stringify` counts it. Anything that is not a
6
+ * plain object - a Date, a Map, a class instance - is equal to itself only.
7
+ */
8
+ export declare function deepEqual<T>(a: T, b: T): boolean;
@@ -0,0 +1,24 @@
1
+ import { isPlainObject } from "../guards.js";
2
+ // src/json/deep-equal.ts
3
+ /**
4
+ * Are `a` and `b` the same value? `===` answers for anything that is the same
5
+ * value; arrays compare by order and length; plain objects compare by content
6
+ * whatever order their keys were written in. A key whose value is `undefined`
7
+ * counts as absent, the way `JSON.stringify` counts it. Anything that is not a
8
+ * plain object - a Date, a Map, a class instance - is equal to itself only.
9
+ */
10
+ function deepEqual(a, b) {
11
+ return a === b || sameContent(a, b);
12
+ }
13
+ function sameContent(a, b) {
14
+ if (a === b) return true;
15
+ if (Array.isArray(a)) return Array.isArray(b) && sameList(a, b);
16
+ if (!isPlainObject(a) || !isPlainObject(b)) return false;
17
+ const keys = Object.keys(a).filter((key) => a[key] !== void 0);
18
+ const others = Object.keys(b).filter((key) => b[key] !== void 0);
19
+ return keys.length === others.length && keys.every((key) => sameContent(a[key], b[key]));
20
+ }
21
+ function sameList(a, b) {
22
+ return a.length === b.length && a.every((item, index) => sameContent(item, b[index]));
23
+ }
24
+ export { deepEqual };
@@ -1,50 +1,46 @@
1
+ // src/json/strip-json-comments.ts
2
+ /** The index just past the string literal that starts at `start`. */
1
3
  function skipString(text, start) {
2
- let i = start + 1;
3
- while (i < text.length && text[i] !== '"') i += text[i] === "\\" ? 2 : 1;
4
- return i + 1;
4
+ let i = start + 1;
5
+ while (i < text.length && text[i] !== "\"") i += text[i] === "\\" ? 2 : 1;
6
+ return i + 1;
5
7
  }
6
8
  function removeComments(text) {
7
- let out = "";
8
- let i = 0;
9
- while (i < text.length) {
10
- if (text[i] === '"') {
11
- const end = skipString(text, i);
12
- out += text.slice(i, end);
13
- i = end;
14
- } else if (text[i] === "/" && text[i + 1] === "/") {
15
- while (i < text.length && text[i] !== "\n") i++;
16
- } else if (text[i] === "/" && text[i + 1] === "*") {
17
- const end = text.indexOf("*/", i + 2);
18
- i = end === -1 ? text.length : end + 2;
19
- out += " ";
20
- } else {
21
- out += text[i++];
22
- }
23
- }
24
- return out;
9
+ let out = "";
10
+ let i = 0;
11
+ while (i < text.length) if (text[i] === "\"") {
12
+ const end = skipString(text, i);
13
+ out += text.slice(i, end);
14
+ i = end;
15
+ } else if (text[i] === "/" && text[i + 1] === "/") while (i < text.length && text[i] !== "\n") i++;
16
+ else if (text[i] === "/" && text[i + 1] === "*") {
17
+ const end = text.indexOf("*/", i + 2);
18
+ i = end === -1 ? text.length : end + 2;
19
+ out += " ";
20
+ } else out += text[i++];
21
+ return out;
25
22
  }
26
23
  function removeTrailingCommas(text) {
27
- let out = "";
28
- let i = 0;
29
- while (i < text.length) {
30
- if (text[i] === '"') {
31
- const end = skipString(text, i);
32
- out += text.slice(i, end);
33
- i = end;
34
- } else if (text[i] === ",") {
35
- let next = i + 1;
36
- while (/\s/.test(text[next] ?? "")) next++;
37
- if (text[next] !== "}" && text[next] !== "]") out += ",";
38
- i++;
39
- } else {
40
- out += text[i++];
41
- }
42
- }
43
- return out;
24
+ let out = "";
25
+ let i = 0;
26
+ while (i < text.length) if (text[i] === "\"") {
27
+ const end = skipString(text, i);
28
+ out += text.slice(i, end);
29
+ i = end;
30
+ } else if (text[i] === ",") {
31
+ let next = i + 1;
32
+ while (/\s/.test(text[next] ?? "")) next++;
33
+ if (text[next] !== "}" && text[next] !== "]") out += ",";
34
+ i++;
35
+ } else out += text[i++];
36
+ return out;
44
37
  }
38
+ /**
39
+ * Removes comments and trailing commas from JSON text, the two things Monaco
40
+ * tolerates when `allowComments` is on and `JSON.parse` does not. String
41
+ * contents are left alone.
42
+ */
45
43
  function stripJsonComments(text) {
46
- return removeTrailingCommas(removeComments(text));
44
+ return removeTrailingCommas(removeComments(text));
47
45
  }
48
- export {
49
- stripJsonComments
50
- };
46
+ export { stripJsonComments };
package/dist/noop.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /** A stable empty function: the same reference on every import, so it is safe in a dependency array or an equality check. */
2
+ export declare const noop: () => void;
package/dist/noop.js ADDED
@@ -0,0 +1,4 @@
1
+ // src/noop.ts
2
+ /** A stable empty function: the same reference on every import, so it is safe in a dependency array or an equality check. */
3
+ var noop = () => {};
4
+ export { noop };
@@ -0,0 +1,2 @@
1
+ /** The text of a thrown value: a string, or the `message` of an object. */
2
+ export declare function errorMessageOf(error: unknown): string | undefined;
@@ -0,0 +1,10 @@
1
+ // src/notification/error-message.ts
2
+ /** The text of a thrown value: a string, or the `message` of an object. */
3
+ function errorMessageOf(error) {
4
+ if (typeof error === "string") return error === "" ? void 0 : error;
5
+ if (typeof error === "object" && error !== null && "message" in error) {
6
+ const { message } = error;
7
+ if (typeof message === "string" && message !== "") return message;
8
+ }
9
+ }
10
+ export { errorMessageOf };
@@ -1,9 +1,10 @@
1
+ import type { TranslateParamValues } from "../i18n/messages.js";
1
2
  export interface Notification {
2
3
  id: number;
3
4
  /** An i18n message KEY — translation/rendering is the UI layer's job. */
4
5
  message: string;
5
6
  type: "info" | "success" | "warning" | "error";
6
- messageArgs?: Record<string, unknown>;
7
+ messageArgs?: TranslateParamValues;
7
8
  /**
8
9
  * True for optimistic-with-Undo notifications: the adapter renders an Undo
9
10
  * action and treats auto-hide/dismiss as a COMMIT (via `onClose`).
@@ -29,7 +30,7 @@ export interface Notification {
29
30
  /** The caller-facing options for `notify` (id and derived fields excluded). */
30
31
  export interface NotifyOptions {
31
32
  type?: Notification["type"];
32
- messageArgs?: Record<string, unknown>;
33
+ messageArgs?: TranslateParamValues;
33
34
  undoable?: boolean;
34
35
  autoHideDuration?: number;
35
36
  undo?: () => void;