@scalar/api-client 3.5.1 → 3.6.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 (113) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +0 -1
  5. package/dist/style.css +3916 -4768
  6. package/dist/styles/tailwind.config.css +20 -0
  7. package/dist/styles/utilities.css +45 -0
  8. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  10. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  11. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +1 -1
  12. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  13. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
  14. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  15. package/dist/v2/constants.js +1 -1
  16. package/dist/v2/features/app/App.vue.d.ts +15 -31
  17. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  18. package/dist/v2/features/app/App.vue.js.map +1 -1
  19. package/dist/v2/features/app/App.vue.script.js +107 -28
  20. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  21. package/dist/v2/features/app/app-state.d.ts +10 -14
  22. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  23. package/dist/v2/features/app/app-state.js +53 -21
  24. package/dist/v2/features/app/app-state.js.map +1 -1
  25. package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -1
  26. package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -1
  27. package/dist/v2/features/app/components/AppHeader.vue.script.js +1 -1
  28. package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -1
  29. package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts +32 -0
  30. package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts.map +1 -0
  31. package/dist/v2/features/app/components/AppHeaderActions.vue.js +7 -0
  32. package/dist/v2/features/app/components/AppHeaderActions.vue.js.map +1 -0
  33. package/dist/v2/features/app/components/AppHeaderActions.vue.script.js +170 -0
  34. package/dist/v2/features/app/components/AppHeaderActions.vue.script.js.map +1 -0
  35. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -3
  36. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  37. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  38. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  39. package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -2
  40. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  41. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts +1 -2
  42. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts.map +1 -1
  43. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js +1 -1
  44. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js.map +1 -1
  45. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js +3 -34
  46. package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js.map +1 -1
  47. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts +1 -1
  48. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts.map +1 -1
  49. package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts +77 -0
  50. package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts.map +1 -0
  51. package/dist/v2/features/app/components/PublishDocumentModal.vue.js +7 -0
  52. package/dist/v2/features/app/components/PublishDocumentModal.vue.js.map +1 -0
  53. package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js +209 -0
  54. package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js.map +1 -0
  55. package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.d.ts.map +1 -0
  56. package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.js +2 -2
  57. package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.js.map +1 -0
  58. package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.script.js +1 -1
  59. package/dist/v2/features/{collection/components/SyncConflictResolutionEditor.vue.js.map → app/components/SyncConflictResolutionEditor.vue.script.js.map} +1 -1
  60. package/dist/v2/features/app/helpers/check-version-conflict.d.ts +8 -5
  61. package/dist/v2/features/app/helpers/check-version-conflict.d.ts.map +1 -1
  62. package/dist/v2/features/app/helpers/check-version-conflict.js +10 -7
  63. package/dist/v2/features/app/helpers/check-version-conflict.js.map +1 -1
  64. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +8 -5
  65. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  66. package/dist/v2/features/app/helpers/create-api-client-app.js +2 -2
  67. package/dist/v2/features/app/helpers/create-api-client-app.js.map +1 -1
  68. package/dist/v2/features/app/helpers/load-registry-document.d.ts +1 -10
  69. package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -1
  70. package/dist/v2/features/app/helpers/load-registry-document.js +6 -5
  71. package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -1
  72. package/dist/v2/features/app/helpers/registry-error-messages.d.ts +23 -0
  73. package/dist/v2/features/app/helpers/registry-error-messages.d.ts.map +1 -0
  74. package/dist/v2/features/app/helpers/registry-error-messages.js +63 -0
  75. package/dist/v2/features/app/helpers/registry-error-messages.js.map +1 -0
  76. package/dist/v2/features/app/hooks/use-active-document-version.d.ts +2 -1
  77. package/dist/v2/features/app/hooks/use-active-document-version.d.ts.map +1 -1
  78. package/dist/v2/features/app/hooks/use-active-document-version.js.map +1 -1
  79. package/dist/v2/features/app/hooks/use-document-sync.d.ts +126 -0
  80. package/dist/v2/features/app/hooks/use-document-sync.d.ts.map +1 -0
  81. package/dist/v2/features/app/hooks/use-document-sync.js +448 -0
  82. package/dist/v2/features/app/hooks/use-document-sync.js.map +1 -0
  83. package/dist/v2/features/app/hooks/use-network-status.d.ts +29 -0
  84. package/dist/v2/features/app/hooks/use-network-status.d.ts.map +1 -0
  85. package/dist/v2/features/app/hooks/use-network-status.js +58 -0
  86. package/dist/v2/features/app/hooks/use-network-status.js.map +1 -0
  87. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +1 -25
  88. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -1
  89. package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -1
  90. package/dist/v2/features/app/index.d.ts +1 -1
  91. package/dist/v2/features/app/index.d.ts.map +1 -1
  92. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  93. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  94. package/dist/v2/features/collection/DocumentCollection.vue.script.js +43 -277
  95. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  96. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -1
  97. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js.map +1 -1
  98. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js +25 -9
  99. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js.map +1 -1
  100. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts.map +1 -1
  101. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +5 -5
  102. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js.map +1 -1
  103. package/dist/v2/types/configuration.d.ts +273 -7
  104. package/dist/v2/types/configuration.d.ts.map +1 -1
  105. package/dist/vue-styles.css +1389 -0
  106. package/package.json +21 -15
  107. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js +0 -7
  108. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js.map +0 -1
  109. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js +0 -51
  110. package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js.map +0 -1
  111. package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.d.ts.map +0 -1
  112. package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.script.js.map +0 -1
  113. /package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.d.ts +0 -0
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "3.5.1",
21
+ "version": "3.6.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -29,6 +29,9 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "default": "./dist/index.js"
31
31
  },
32
+ "./style.css": "./dist/style.css",
33
+ "./tailwind.config.css": "./dist/styles/tailwind.config.css",
34
+ "./vue-styles.css": "./dist/vue-styles.css",
32
35
  "./*.css": {
33
36
  "import": "./dist/*.css",
34
37
  "require": "./dist/*.css",
@@ -332,24 +335,25 @@
332
335
  "vue-router": "5.0.4",
333
336
  "yaml": "^2.8.3",
334
337
  "zod": "^4.3.5",
335
- "@scalar/components": "0.24.1",
336
- "@scalar/helpers": "0.5.5",
338
+ "@scalar/components": "0.24.2",
339
+ "@scalar/helpers": "0.6.0",
337
340
  "@scalar/icons": "0.7.2",
338
- "@scalar/json-magic": "0.12.11",
339
- "@scalar/oas-utils": "0.15.1",
341
+ "@scalar/oas-utils": "0.15.2",
342
+ "@scalar/json-magic": "0.12.12",
340
343
  "@scalar/openapi-types": "0.8.0",
341
- "@scalar/postman-to-openapi": "0.7.4",
342
- "@scalar/sidebar": "0.9.9",
343
- "@scalar/snippetz": "0.9.5",
344
+ "@scalar/postman-to-openapi": "0.7.5",
345
+ "@scalar/snippetz": "0.9.6",
344
346
  "@scalar/themes": "0.15.3",
345
- "@scalar/types": "0.9.5",
347
+ "@scalar/types": "0.9.6",
346
348
  "@scalar/use-codemirror": "0.14.11",
347
- "@scalar/use-hooks": "0.4.3",
349
+ "@scalar/validation": "0.3.2",
348
350
  "@scalar/use-toasts": "0.10.2",
349
- "@scalar/workspace-store": "0.49.1",
350
- "@scalar/validation": "0.3.2"
351
+ "@scalar/use-hooks": "0.4.3",
352
+ "@scalar/sidebar": "0.9.10",
353
+ "@scalar/workspace-store": "0.49.2"
351
354
  },
352
355
  "devDependencies": {
356
+ "@tailwindcss/cli": "^4.2.4",
353
357
  "@tailwindcss/vite": "^4.2.0",
354
358
  "@types/shell-quote": "^1.7.5",
355
359
  "@vitejs/plugin-vue": "^6.0.3",
@@ -362,10 +366,12 @@
362
366
  "vite": "8.0.0",
363
367
  "vite-svg-loader": "5.1.1",
364
368
  "vitest": "4.1.0",
365
- "@scalar/pre-post-request-scripts": "0.4.10"
369
+ "@scalar/sdk": "0.1.5",
370
+ "@scalar/pre-post-request-scripts": "0.4.11"
366
371
  },
367
372
  "scripts": {
368
- "build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
373
+ "build": "vite build && pnpm build:styles && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
374
+ "build:styles": "cp -r src/styles dist && tailwindcss --optimize -i src/style.css -o dist/style.css && cat dist/vue-styles.css >> dist/style.css",
369
375
  "dev": "pnpm playground:web",
370
376
  "playground:app": "vite ./playground/app -c ./vite.config.ts",
371
377
  "playground:app:build": "vite build ./playground/app -c ./vite.previews.config.ts",
@@ -373,10 +379,10 @@
373
379
  "playground:web": "vite ./playground/web -c ./vite.config.ts",
374
380
  "preview": "vite preview",
375
381
  "test": "vitest --run",
376
- "test:watch": "vitest",
377
382
  "test:benchmark": "vitest bench",
378
383
  "test:benchmark:compare": "vitest bench --compare test-results/test-benchmark.json",
379
384
  "test:benchmark:save": "vitest bench --outputJson test-results/test-benchmark.json",
385
+ "test:watch": "vitest",
380
386
  "types:check": "vue-tsc --noEmit"
381
387
  }
382
388
  }
@@ -1,7 +0,0 @@
1
- import DocumentSyncIndicator_vue_vue_type_script_setup_true_lang_default from "./DocumentSyncIndicator.vue.script.js";
2
- //#region src/v2/features/app/components/DocumentSyncIndicator.vue
3
- var DocumentSyncIndicator_default = DocumentSyncIndicator_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
- export { DocumentSyncIndicator_default as default };
6
-
7
- //# sourceMappingURL=DocumentSyncIndicator.vue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DocumentSyncIndicator.vue.js","names":[],"sources":["../../../../../src/v2/features/app/components/DocumentSyncIndicator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { AppState } from '@/v2/features/app/app-state'\nimport { VERSION_STATUS_PRESENTATION } from '@/v2/features/app/helpers/version-status-presentation'\nimport { useActiveDocumentVersion } from '@/v2/features/app/hooks/use-active-document-version'\nimport type { RegistryDocumentsState } from '@/v2/features/app/hooks/use-sidebar-documents'\n\nconst { app, registryDocuments = { status: 'success', documents: [] } } =\n defineProps<{\n /** App state used to read the active document and registry meta. */\n app: AppState\n /**\n * Registry documents state. Mirrors the prop accepted by\n * `DocumentBreadcrumb` so both header surfaces resolve the same active\n * document group.\n */\n registryDocuments?: RegistryDocumentsState\n }>()\n\n/**\n * Resolve the currently active version through the shared composable. The\n * indicator never renders a picker — it only mirrors the status icon — so\n * the composable's `activeVersion` is the only field we need.\n *\n * The composable does not run any network checks; the breadcrumb owns\n * `useVersionConflictCheck` and the indicator simply reads back the cached\n * status that flows through `useSidebarDocuments`.\n */\nconst { activeVersion } = useActiveDocumentVersion({\n app,\n registryDocuments: () => registryDocuments,\n})\n\n/** Presentation block (icon, colour, label) for the active version's status. */\nconst presentation = computed(() => {\n const status = activeVersion.value?.status\n if (!status) {\n return undefined\n }\n return VERSION_STATUS_PRESENTATION[status]\n})\n</script>\n\n<template>\n <component\n :is=\"presentation.icon\"\n v-if=\"presentation\"\n :aria-label=\"presentation.label\"\n class=\"size-4 shrink-0\"\n :class=\"presentation.class\"\n :title=\"presentation.label\" />\n</template>\n"],"mappings":""}
@@ -1,51 +0,0 @@
1
- import { VERSION_STATUS_PRESENTATION } from "../helpers/version-status-presentation.js";
2
- import { useActiveDocumentVersion } from "../hooks/use-active-document-version.js";
3
- import { computed, createBlock, createCommentVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent } from "vue";
4
- //#region src/v2/features/app/components/DocumentSyncIndicator.vue?vue&type=script&setup=true&lang.ts
5
- var DocumentSyncIndicator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
6
- __name: "DocumentSyncIndicator",
7
- props: {
8
- app: {},
9
- registryDocuments: { default: () => ({
10
- status: "success",
11
- documents: []
12
- }) }
13
- },
14
- setup(__props) {
15
- /**
16
- * Resolve the currently active version through the shared composable. The
17
- * indicator never renders a picker — it only mirrors the status icon — so
18
- * the composable's `activeVersion` is the only field we need.
19
- *
20
- * The composable does not run any network checks; the breadcrumb owns
21
- * `useVersionConflictCheck` and the indicator simply reads back the cached
22
- * status that flows through `useSidebarDocuments`.
23
- */
24
- const { activeVersion } = useActiveDocumentVersion({
25
- app: __props.app,
26
- registryDocuments: () => __props.registryDocuments
27
- });
28
- /** Presentation block (icon, colour, label) for the active version's status. */
29
- const presentation = computed(() => {
30
- const status = activeVersion.value?.status;
31
- if (!status) return;
32
- return VERSION_STATUS_PRESENTATION[status];
33
- });
34
- return (_ctx, _cache) => {
35
- return presentation.value ? (openBlock(), createBlock(resolveDynamicComponent(presentation.value.icon), {
36
- key: 0,
37
- "aria-label": presentation.value.label,
38
- class: normalizeClass(["size-4 shrink-0", presentation.value.class]),
39
- title: presentation.value.label
40
- }, null, 8, [
41
- "aria-label",
42
- "class",
43
- "title"
44
- ])) : createCommentVNode("", true);
45
- };
46
- }
47
- });
48
- //#endregion
49
- export { DocumentSyncIndicator_vue_vue_type_script_setup_true_lang_default as default };
50
-
51
- //# sourceMappingURL=DocumentSyncIndicator.vue.script.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DocumentSyncIndicator.vue.script.js","names":[],"sources":["../../../../../src/v2/features/app/components/DocumentSyncIndicator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { AppState } from '@/v2/features/app/app-state'\nimport { VERSION_STATUS_PRESENTATION } from '@/v2/features/app/helpers/version-status-presentation'\nimport { useActiveDocumentVersion } from '@/v2/features/app/hooks/use-active-document-version'\nimport type { RegistryDocumentsState } from '@/v2/features/app/hooks/use-sidebar-documents'\n\nconst { app, registryDocuments = { status: 'success', documents: [] } } =\n defineProps<{\n /** App state used to read the active document and registry meta. */\n app: AppState\n /**\n * Registry documents state. Mirrors the prop accepted by\n * `DocumentBreadcrumb` so both header surfaces resolve the same active\n * document group.\n */\n registryDocuments?: RegistryDocumentsState\n }>()\n\n/**\n * Resolve the currently active version through the shared composable. The\n * indicator never renders a picker — it only mirrors the status icon — so\n * the composable's `activeVersion` is the only field we need.\n *\n * The composable does not run any network checks; the breadcrumb owns\n * `useVersionConflictCheck` and the indicator simply reads back the cached\n * status that flows through `useSidebarDocuments`.\n */\nconst { activeVersion } = useActiveDocumentVersion({\n app,\n registryDocuments: () => registryDocuments,\n})\n\n/** Presentation block (icon, colour, label) for the active version's status. */\nconst presentation = computed(() => {\n const status = activeVersion.value?.status\n if (!status) {\n return undefined\n }\n return VERSION_STATUS_PRESENTATION[status]\n})\n</script>\n\n<template>\n <component\n :is=\"presentation.icon\"\n v-if=\"presentation\"\n :aria-label=\"presentation.label\"\n class=\"size-4 shrink-0\"\n :class=\"presentation.class\"\n :title=\"presentation.label\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,EAAE,kBAAkB,yBAAyB;GACjD,KAAE,QAAA;GACF,yBAAyB,QAAA;GAC1B,CAAA;;EAGD,MAAM,eAAe,eAAe;GAClC,MAAM,SAAS,cAAc,OAAO;AACpC,OAAI,CAAC,OACH;AAEF,UAAO,4BAA4B;IACpC;;UAMS,aAAA,SAAA,WAAA,EAFR,YAMgC,wBALzB,aAAA,MAAa,KAAI,EAAA;;IAErB,cAAY,aAAA,MAAa;IAC1B,OAAK,eAAA,CAAC,mBACE,aAAA,MAAa,MAAK,CAAA;IACzB,OAAO,aAAA,MAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncConflictResolutionEditor.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/SyncConflictResolutionEditor.vue"],"names":[],"mappings":"AA0UA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAOpD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAA;IAChD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAC;AA+UF,QAAA,MAAM,YAAY;;0BAxUM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;0BAAvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;kFA2U7C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncConflictResolutionEditor.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/SyncConflictResolutionEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components'\nimport { type merge } from '@scalar/json-magic/diff'\nimport { useToasts } from '@scalar/use-toasts'\nimport { computed, onMounted, onUnmounted, ref } from 'vue'\n\nimport { useSplitResize } from '@/v2/components/resize'\nimport { useThreeWayMergeEditor } from '@/v2/features/editor/hooks/use-three-way-merge-editor'\n\nconst { conflicts, baseDocument, resolvedDocument } = defineProps<{\n conflicts: ReturnType<typeof merge>['conflicts']\n baseDocument: Record<string, unknown>\n resolvedDocument: Record<string, unknown>\n}>()\n\nconst emit = defineEmits<{\n applyChanges: [\n payload: {\n resolvedDocument: Record<string, unknown>\n },\n ]\n}>()\n\nconst { toast } = useToasts()\n\nconst splitContainerRef = ref<HTMLDivElement>()\nconst topEditorsRowRef = ref<HTMLDivElement>()\nconst topPaneSize = ref(50)\nconst leftPaneSize = ref(50)\n\nconst { onHorizontalResizeStart, onVerticalResizeStart, stopActiveResize } =\n useSplitResize({\n horizontalContainerRef: topEditorsRowRef,\n verticalContainerRef: splitContainerRef,\n leftPaneSize,\n topPaneSize,\n horizontalMin: 20,\n horizontalMax: 80,\n verticalMin: 25,\n verticalMax: 75,\n })\n\nconst mergeEditor = useThreeWayMergeEditor({\n baseDocument,\n resolvedDocument,\n conflicts,\n onApplyChanges: (resolvedDoc) =>\n emit('applyChanges', { resolvedDocument: resolvedDoc }),\n onError: (message) => toast(message, 'error'),\n})\n\nconst conflictsLeft = computed(() => mergeEditor.conflictsLeft.value)\n\nconst topPaneStyle = computed(() => ({ height: `${topPaneSize.value}%` }))\nconst leftPaneStyle = computed(() => ({ width: `${leftPaneSize.value}%` }))\nconst rightPaneStyle = computed(() => ({\n width: `${100 - leftPaneSize.value}%`,\n}))\n\nconst localChangesEditorRef = ref<HTMLDivElement>()\nconst remoteChangesEditorRef = ref<HTMLDivElement>()\nconst resultEditorRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n const localEl = localChangesEditorRef.value\n const remoteEl = remoteChangesEditorRef.value\n const resultEl = resultEditorRef.value\n if (localEl && remoteEl && resultEl) {\n mergeEditor.init({\n local: localEl,\n remote: remoteEl,\n result: resultEl,\n })\n }\n})\n\nonUnmounted(() => {\n stopActiveResize()\n mergeEditor.dispose()\n})\n</script>\n\n<template>\n <p class=\"text-c-2 text-xs\">\n Resolve conflicts inline in the full document editor. Use the buttons inside\n the editor for each conflict.\n </p>\n\n <div\n ref=\"splitContainerRef\"\n class=\"flex min-h-0 flex-1 flex-col overflow-hidden\">\n <div\n ref=\"topEditorsRowRef\"\n class=\"flex min-h-0 gap-1 p-1\"\n :style=\"topPaneStyle\">\n <div\n class=\"sync-editor-pane border-c-3 flex min-h-0 flex-col overflow-hidden rounded-lg border\"\n :style=\"leftPaneStyle\">\n <div\n class=\"sync-pane-title text-c-2 border-c-3 shrink-0 border-b px-2 py-1 text-[11px]\">\n Current\n </div>\n <div\n ref=\"localChangesEditorRef\"\n class=\"min-h-0 flex-1\"></div>\n </div>\n\n <button\n aria-label=\"Resize current and remote editors\"\n class=\"resize-handle resize-handle-col\"\n type=\"button\"\n @pointerdown=\"onHorizontalResizeStart\" />\n\n <div\n class=\"sync-editor-pane border-c-3 flex min-h-0 flex-col overflow-hidden rounded-lg border\"\n :style=\"rightPaneStyle\">\n <div\n class=\"sync-pane-title text-c-2 border-c-3 shrink-0 border-b px-2 py-1 text-[11px]\">\n Remote\n </div>\n <div\n ref=\"remoteChangesEditorRef\"\n class=\"min-h-0 flex-1\"></div>\n </div>\n </div>\n\n <button\n aria-label=\"Resize top and result editors\"\n class=\"resize-handle resize-handle-row\"\n type=\"button\"\n @pointerdown=\"onVerticalResizeStart\" />\n\n <div\n class=\"sync-editor-pane border-c-3 mx-1 mb-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border\">\n <div\n class=\"sync-pane-title text-c-2 border-c-3 flex shrink-0 items-center justify-between border-b px-2 py-1 text-[11px]\">\n <span> Result </span>\n <div class=\"flex items-center gap-2\">\n <span class=\"text-c-2 text-[11px] normal-case\">\n {{ conflictsLeft }} conflict{{ conflictsLeft === 1 ? '' : 's' }}\n left\n </span>\n <ScalarButton\n :disabled=\"conflictsLeft === 0\"\n size=\"xs\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"mergeEditor.goToNextConflict\">\n Next Conflict\n </ScalarButton>\n </div>\n </div>\n <div\n ref=\"resultEditorRef\"\n class=\"min-h-0 flex-1\"></div>\n </div>\n\n <div class=\"flex shrink-0 items-center justify-end gap-2\">\n <ScalarButton\n :disabled=\"conflictsLeft > 0\"\n size=\"xs\"\n type=\"button\"\n @click=\"mergeEditor.applyResolvedConflicts\">\n Apply changes\n </ScalarButton>\n </div>\n </div>\n</template>\n<style scoped>\n.editor-container {\n width: 100%;\n height: 100%;\n}\n\n.sync-layout-root {\n background: color-mix(\n in srgb,\n var(--scalar-color-background-1, #1e1e1e) 96%,\n transparent\n );\n}\n\n.sync-editor-pane {\n background: color-mix(\n in srgb,\n var(--scalar-color-background-1, #1e1e1e) 95%,\n transparent\n );\n}\n\n.sync-pane-title {\n letter-spacing: 0.03em;\n text-transform: uppercase;\n font-weight: 600;\n background: color-mix(\n in srgb,\n var(--scalar-color-background-2, #2d2d30) 85%,\n transparent\n );\n}\n\n.resize-handle {\n position: relative;\n display: block;\n flex-shrink: 0;\n border: none;\n border-radius: 999px;\n background: transparent;\n transition:\n background-color 0.12s ease,\n box-shadow 0.12s ease;\n}\n\n.resize-handle::before {\n content: '';\n position: absolute;\n border-radius: 999px;\n opacity: 1;\n transition:\n background-color 0.12s ease,\n transform 0.12s ease;\n}\n\n.resize-handle:hover {\n background: color-mix(\n in srgb,\n var(--scalar-color-accent, #007acc) 12%,\n transparent\n );\n}\n\n.resize-handle:active {\n background: color-mix(\n in srgb,\n var(--scalar-color-accent, #007acc) 18%,\n transparent\n );\n}\n\n.resize-handle:focus-visible {\n outline: none;\n box-shadow: 0 0 0 1px\n color-mix(in srgb, var(--scalar-color-accent, #007acc) 70%, transparent);\n}\n\n.resize-handle-col {\n width: 8px;\n min-height: 44px;\n margin: 2px 0;\n cursor: col-resize;\n}\n\n.resize-handle-col::before {\n top: 50%;\n left: 50%;\n width: 1px;\n height: calc(100% - 8px);\n transform: translate(-50%, -50%);\n background: color-mix(\n in srgb,\n var(--scalar-color-border, #3c3c3c) 85%,\n transparent\n );\n}\n\n.resize-handle-row {\n height: 8px;\n margin: 0 4px;\n cursor: row-resize;\n}\n\n.resize-handle-row::before {\n top: 50%;\n left: 50%;\n width: calc(100% - 8px);\n height: 1px;\n transform: translate(-50%, -50%);\n background: color-mix(\n in srgb,\n var(--scalar-color-border, #3c3c3c) 85%,\n transparent\n );\n}\n\n.resize-handle-col:hover::before,\n.resize-handle-col:active::before,\n.resize-handle-row:hover::before,\n.resize-handle-row:active::before {\n background: color-mix(\n in srgb,\n var(--scalar-color-accent, #007acc) 78%,\n transparent\n );\n}\n\n:deep(.json-path-highlight) {\n background-color: rgba(255, 200, 0, 0.35);\n border-radius: 4px;\n}\n\n:deep(.json-focus-highlight-box-single) {\n border: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n box-sizing: border-box;\n}\n\n:deep(.json-focus-highlight-box-top) {\n border-top: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n border-left: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n border-right: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n box-sizing: border-box;\n}\n\n:deep(.json-focus-highlight-box-middle) {\n border-left: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n border-right: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n box-sizing: border-box;\n}\n\n:deep(.json-focus-highlight-box-bottom) {\n border-bottom: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n border-left: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n border-right: 2px solid color-mix(in srgb, #facc15 90%, #eab308 10%);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, #fde047 35%, transparent);\n box-sizing: border-box;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAeA,MAAM,OAAO;EAQb,MAAM,EAAE,UAAU,WAAU;EAE5B,MAAM,oBAAoB,KAAoB;EAC9C,MAAM,mBAAmB,KAAoB;EAC7C,MAAM,cAAc,IAAI,GAAE;EAC1B,MAAM,eAAe,IAAI,GAAE;EAE3B,MAAM,EAAE,yBAAyB,uBAAuB,qBACtD,eAAe;GACb,wBAAwB;GACxB,sBAAsB;GACtB;GACA;GACA,eAAe;GACf,eAAe;GACf,aAAa;GACb,aAAa;GACd,CAAA;EAEH,MAAM,cAAc,uBAAuB;GACzC,cAAW,QAAA;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