canopycms 0.0.16 → 0.0.17

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 (150) hide show
  1. package/dist/ai/generate.js +3 -3
  2. package/dist/ai/handler.js +5 -5
  3. package/dist/ai/index.js +3 -3
  4. package/dist/ai/resolve-branch.js +2 -2
  5. package/dist/api/__test__/mock-client.js +1 -1
  6. package/dist/api/assets.js +1 -1
  7. package/dist/api/branch-merge.js +3 -3
  8. package/dist/api/branch-review.js +4 -4
  9. package/dist/api/branch-status.js +8 -8
  10. package/dist/api/branch-withdraw.js +5 -5
  11. package/dist/api/branch.js +9 -9
  12. package/dist/api/comments.js +4 -4
  13. package/dist/api/content.js +5 -5
  14. package/dist/api/entries.js +8 -8
  15. package/dist/api/github-sync.js +3 -3
  16. package/dist/api/groups.js +4 -4
  17. package/dist/api/guards.js +1 -1
  18. package/dist/api/index.js +3 -3
  19. package/dist/api/permissions.js +4 -4
  20. package/dist/api/reference-options.js +5 -5
  21. package/dist/api/resolve-references.js +4 -4
  22. package/dist/api/route-builder.js +1 -1
  23. package/dist/api/schema.js +5 -5
  24. package/dist/api/settings-helpers.js +1 -1
  25. package/dist/api/user.js +1 -1
  26. package/dist/api/validators.js +3 -3
  27. package/dist/asset-store.js +1 -1
  28. package/dist/auth/cache.js +2 -2
  29. package/dist/auth/caching-auth-plugin.js +1 -1
  30. package/dist/auth/file-based-auth-cache.js +1 -1
  31. package/dist/auth/index.js +1 -1
  32. package/dist/authorization/branch.js +1 -1
  33. package/dist/authorization/content.js +3 -3
  34. package/dist/authorization/groups/index.js +2 -2
  35. package/dist/authorization/groups/loader.js +4 -4
  36. package/dist/authorization/index.js +8 -8
  37. package/dist/authorization/path.js +1 -1
  38. package/dist/authorization/permissions/index.js +2 -2
  39. package/dist/authorization/permissions/loader.js +3 -3
  40. package/dist/authorization/permissions/schema.js +1 -1
  41. package/dist/authorization/test-utils.js +1 -1
  42. package/dist/authorization/validation.js +1 -1
  43. package/dist/branch-metadata.js +3 -3
  44. package/dist/branch-registry.js +2 -2
  45. package/dist/branch-schema-cache.js +2 -2
  46. package/dist/branch-workspace.js +6 -6
  47. package/dist/build/generate-ai-content.js +4 -4
  48. package/dist/build/index.js +1 -1
  49. package/dist/cli/cli.js +5 -5
  50. package/dist/cli/generate-ai-content.js +1 -9
  51. package/dist/cli/init.js +2 -10
  52. package/dist/cli/sync.js +1 -1
  53. package/dist/client.js +9 -9
  54. package/dist/config/flatten.js +2 -2
  55. package/dist/config/helpers.js +3 -3
  56. package/dist/config/index.js +9 -9
  57. package/dist/config/schemas/collection.js +1 -1
  58. package/dist/config/schemas/config.js +2 -2
  59. package/dist/config/schemas/field.js +1 -1
  60. package/dist/config/validation.js +2 -2
  61. package/dist/config-test.js +2 -2
  62. package/dist/config.js +2 -2
  63. package/dist/content-id-index.js +2 -2
  64. package/dist/content-listing.js +7 -7
  65. package/dist/content-reader.js +5 -5
  66. package/dist/content-store.js +5 -5
  67. package/dist/content-tree.js +1 -1
  68. package/dist/context.js +6 -6
  69. package/dist/editor/BranchManager.js +4 -4
  70. package/dist/editor/CanopyEditor.js +3 -3
  71. package/dist/editor/CanopyEditorPage.js +1 -1
  72. package/dist/editor/CommentsPanel.js +1 -1
  73. package/dist/editor/Editor.js +18 -18
  74. package/dist/editor/EntryNavigator.js +1 -1
  75. package/dist/editor/FormRenderer.js +12 -12
  76. package/dist/editor/GroupManager.js +1 -1
  77. package/dist/editor/PermissionManager.js +1 -1
  78. package/dist/editor/client-reference-resolver.js +1 -1
  79. package/dist/editor/comments/BranchComments.js +1 -1
  80. package/dist/editor/comments/EntryComments.js +1 -1
  81. package/dist/editor/comments/FieldWrapper.js +1 -1
  82. package/dist/editor/comments/InlineCommentThread.js +1 -1
  83. package/dist/editor/comments/ThreadCarousel.js +1 -1
  84. package/dist/editor/components/EditorHeader.js +1 -1
  85. package/dist/editor/components/UserBadge.js +1 -1
  86. package/dist/editor/components/index.js +3 -3
  87. package/dist/editor/context/ApiClientContext.js +1 -1
  88. package/dist/editor/context/index.js +2 -2
  89. package/dist/editor/editor-utils.js +1 -1
  90. package/dist/editor/fields/BlockField.js +1 -1
  91. package/dist/editor/fields/ObjectField.js +1 -1
  92. package/dist/editor/fields/ReferenceField.js +1 -1
  93. package/dist/editor/group-manager/GroupCard.js +1 -1
  94. package/dist/editor/group-manager/InternalGroupsTab.js +1 -1
  95. package/dist/editor/group-manager/MemberList.js +1 -1
  96. package/dist/editor/group-manager/index.js +9 -9
  97. package/dist/editor/hooks/__test__/test-utils.js +3 -3
  98. package/dist/editor/hooks/index.js +11 -11
  99. package/dist/editor/hooks/useBranchActions.js +1 -1
  100. package/dist/editor/hooks/useBranchManager.js +1 -1
  101. package/dist/editor/hooks/useCommentSystem.js +2 -2
  102. package/dist/editor/hooks/useDraftManager.js +1 -1
  103. package/dist/editor/hooks/useEntryManager.js +3 -3
  104. package/dist/editor/hooks/useGroupManager.js +1 -1
  105. package/dist/editor/hooks/usePermissionManager.js +1 -1
  106. package/dist/editor/hooks/useReferenceResolution.js +1 -1
  107. package/dist/editor/hooks/useSchemaManager.js +1 -1
  108. package/dist/editor/hooks/useUserContext.js +1 -1
  109. package/dist/editor/permission-manager/PermissionEditor.js +4 -4
  110. package/dist/editor/permission-manager/PermissionLevelBadge.js +1 -1
  111. package/dist/editor/permission-manager/PermissionTree.js +3 -3
  112. package/dist/editor/permission-manager/UserSelector.js +1 -1
  113. package/dist/editor/permission-manager/hooks/usePermissionTree.js +2 -2
  114. package/dist/editor/permission-manager/index.js +6 -6
  115. package/dist/editor/preview-bridge.js +1 -1
  116. package/dist/editor/schema-editor/CollectionEditor.js +2 -2
  117. package/dist/editor/schema-editor/index.js +2 -2
  118. package/dist/entry-schema-registry.js +3 -3
  119. package/dist/git-manager.js +4 -4
  120. package/dist/github-service.js +1 -1
  121. package/dist/http/handler.js +7 -7
  122. package/dist/http/index.js +3 -3
  123. package/dist/http/router.js +12 -12
  124. package/dist/id.js +1 -1
  125. package/dist/index.js +6 -6
  126. package/dist/operating-mode/client-unsafe-strategy.js +2 -2
  127. package/dist/operating-mode/client.js +1 -1
  128. package/dist/operating-mode/index.js +2 -2
  129. package/dist/paths/branch.js +1 -1
  130. package/dist/paths/index.js +6 -6
  131. package/dist/paths/test-utils.js +1 -1
  132. package/dist/paths/validation.js +1 -1
  133. package/dist/reference-resolver.js +1 -1
  134. package/dist/schema/index.js +2 -2
  135. package/dist/schema/meta-loader.js +1 -1
  136. package/dist/schema/resolver.js +1 -1
  137. package/dist/schema/schema-store.js +4 -4
  138. package/dist/server.js +13 -13
  139. package/dist/services.js +12 -12
  140. package/dist/settings-branch-utils.js +1 -1
  141. package/dist/settings-workspace.js +3 -3
  142. package/dist/task-queue/index.js +1 -1
  143. package/dist/task-queue/task-queue.js +1 -1
  144. package/dist/user.js +1 -1
  145. package/dist/utils/fs.js +1 -1
  146. package/dist/validation/reference-validator.js +2 -2
  147. package/dist/worker/cms-worker.js +5 -5
  148. package/dist/worker/task-queue-config.js +1 -1
  149. package/dist/worker/task-queue.js +2 -2
  150. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import { ensureBranchRoot } from './paths';
2
- import { getBranchMetadataFileManager, loadBranchContext } from './branch-metadata';
3
- import { isDeployedStatic } from './build-mode';
4
- import { GitManager } from './git-manager';
5
- import { createDebugLogger } from './utils/debug';
1
+ import { ensureBranchRoot } from './paths/index.js';
2
+ import { getBranchMetadataFileManager, loadBranchContext } from './branch-metadata.js';
3
+ import { isDeployedStatic } from './build-mode.js';
4
+ import { GitManager } from './git-manager.js';
5
+ import { createDebugLogger } from './utils/debug.js';
6
6
  const log = createDebugLogger({ prefix: 'BranchWorkspace' });
7
7
  // In-memory lock to prevent concurrent workspace initialization
8
8
  const workspaceInitLocks = new Map();
@@ -84,7 +84,7 @@ export class BranchWorkspaceManager {
84
84
  };
85
85
  }
86
86
  }
87
- export { loadBranchContext } from './branch-metadata';
87
+ export { loadBranchContext } from './branch-metadata.js';
88
88
  /**
89
89
  * Load an existing branch context, or create the workspace if it doesn't exist yet.
90
90
  *
@@ -6,10 +6,10 @@
6
6
  */
7
7
  import fs from 'node:fs/promises';
8
8
  import path from 'node:path';
9
- import { ContentStore } from '../content-store';
10
- import { BranchSchemaCache } from '../branch-schema-cache';
11
- import { generateAIContent } from '../ai/generate';
12
- import { resolveBranchRoot } from '../ai/resolve-branch';
9
+ import { ContentStore } from '../content-store.js';
10
+ import { BranchSchemaCache } from '../branch-schema-cache.js';
11
+ import { generateAIContent } from '../ai/generate.js';
12
+ import { resolveBranchRoot } from '../ai/resolve-branch.js';
13
13
  /**
14
14
  * Generate AI content files and write them to disk.
15
15
  *
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Provides static build utilities for pre-generating content.
5
5
  */
6
- export { generateAIContentFiles } from './generate-ai-content';
6
+ export { generateAIContentFiles } from './generate-ai-content.js';
7
7
  //# sourceMappingURL=index.js.map
package/dist/cli/cli.js CHANGED
@@ -33,7 +33,7 @@ export function resolveSyncDirection(push, pull, abort) {
33
33
  async function main() {
34
34
  const { argv, flags, command } = parseArgs(process.argv.slice(2));
35
35
  if (command === 'init') {
36
- const { init } = await import('./init');
36
+ const { init } = await import('./init.js');
37
37
  const nonInteractive = flags['non-interactive'] === true;
38
38
  const force = flags['force'] === true;
39
39
  const mode = 'dev';
@@ -84,7 +84,7 @@ async function main() {
84
84
  });
85
85
  }
86
86
  else if (command === 'init-deploy') {
87
- const { initDeployAws } = await import('./init');
87
+ const { initDeployAws } = await import('./init.js');
88
88
  const cloud = argv._[1];
89
89
  if (cloud !== 'aws') {
90
90
  console.error('Usage: canopycms init-deploy aws');
@@ -99,7 +99,7 @@ async function main() {
99
99
  });
100
100
  }
101
101
  else if (command === 'worker') {
102
- const { workerRunOnce } = await import('./init');
102
+ const { workerRunOnce } = await import('./init.js');
103
103
  const subcommand = argv._[1];
104
104
  if (subcommand !== 'run-once') {
105
105
  console.error('Usage: canopycms worker run-once');
@@ -127,7 +127,7 @@ async function main() {
127
127
  await workerRunOnce({ projectDir: process.cwd(), authPlugin });
128
128
  }
129
129
  else if (command === 'generate-ai-content') {
130
- const { generateAIContentCLI } = await import('./generate-ai-content');
130
+ const { generateAIContentCLI } = await import('./generate-ai-content.js');
131
131
  await generateAIContentCLI({
132
132
  projectDir: process.cwd(),
133
133
  outputDir: typeof flags['output'] === 'string' ? flags['output'] : undefined,
@@ -136,7 +136,7 @@ async function main() {
136
136
  });
137
137
  }
138
138
  else if (command === 'sync') {
139
- const { sync } = await import('./sync');
139
+ const { sync } = await import('./sync.js');
140
140
  const direction = resolveSyncDirection(flags['push'] === true, flags['pull'] === true, flags['abort'] === true);
141
141
  await sync({
142
142
  projectDir: process.cwd(),
@@ -516,14 +516,6 @@ var init_config2 = __esm({
516
516
  }
517
517
  });
518
518
 
519
- // dist/config.js
520
- var init_config3 = __esm({
521
- "dist/config.js"() {
522
- "use strict";
523
- init_config2();
524
- }
525
- });
526
-
527
519
  // dist/operating-mode/client-unsafe-strategy.js
528
520
  import path3 from "node:path";
529
521
  function operatingStrategy(mode) {
@@ -554,7 +546,7 @@ var init_client_unsafe_strategy = __esm({
554
546
  "dist/operating-mode/client-unsafe-strategy.js"() {
555
547
  "use strict";
556
548
  init_client_safe_strategy();
557
- init_config3();
549
+ init_config2();
558
550
  ProdStrategy = class extends ProdClientSafeStrategy {
559
551
  // All client-safe methods inherited automatically from ProdClientSafeStrategy:
560
552
  // - mode, supportsBranching(), supportsStatusBadge(), supportsComments()
package/dist/cli/init.js CHANGED
@@ -314,14 +314,6 @@ var init_config2 = __esm({
314
314
  }
315
315
  });
316
316
 
317
- // dist/config.js
318
- var init_config3 = __esm({
319
- "dist/config.js"() {
320
- "use strict";
321
- init_config2();
322
- }
323
- });
324
-
325
317
  // dist/cli/templates.js
326
318
  var templates_exports = {};
327
319
  __export(templates_exports, {
@@ -402,7 +394,7 @@ function getTaskQueueDir(config) {
402
394
  var init_task_queue_config = __esm({
403
395
  "dist/worker/task-queue-config.js"() {
404
396
  "use strict";
405
- init_config3();
397
+ init_config2();
406
398
  }
407
399
  });
408
400
 
@@ -974,7 +966,7 @@ var DevClientSafeStrategy = class {
974
966
 
975
967
  // dist/operating-mode/client-unsafe-strategy.js
976
968
  import path from "node:path";
977
- init_config3();
969
+ init_config2();
978
970
  var ProdStrategy = class extends ProdClientSafeStrategy {
979
971
  // All client-safe methods inherited automatically from ProdClientSafeStrategy:
980
972
  // - mode, supportsBranching(), supportsStatusBadge(), supportsComments()
package/dist/cli/sync.js CHANGED
@@ -16,7 +16,7 @@ import fs from 'node:fs/promises';
16
16
  import path from 'node:path';
17
17
  import { simpleGit } from 'simple-git';
18
18
  import * as p from '@clack/prompts';
19
- import { filePathExists } from '../utils/fs';
19
+ import { filePathExists } from '../utils/fs.js';
20
20
  /** Validate that a resolved path stays within the expected parent directory. */
21
21
  function assertWithinDir(resolved, parent, label) {
22
22
  const normalizedResolved = path.resolve(resolved);
package/dist/client.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
- export * from './editor/EditorPanes';
3
- export * from './editor/EntryNavigator';
4
- export * from './editor/Editor';
5
- export * from './editor/preview-bridge';
6
- export * from './editor/canopy-path';
7
- export * from './editor/theme';
8
- export * from './editor/editor-config';
9
- export * from './editor/CanopyEditor';
10
- export * from './editor/CanopyEditorPage';
2
+ export * from './editor/EditorPanes.js';
3
+ export * from './editor/EntryNavigator.js';
4
+ export * from './editor/Editor.js';
5
+ export * from './editor/preview-bridge.js';
6
+ export * from './editor/canopy-path.js';
7
+ export * from './editor/theme.js';
8
+ export * from './editor/editor-config.js';
9
+ export * from './editor/CanopyEditor.js';
10
+ export * from './editor/CanopyEditorPage.js';
11
11
  //# sourceMappingURL=client.js.map
@@ -2,8 +2,8 @@
2
2
  * Schema flattening utilities for O(1) lookups.
3
3
  */
4
4
  import { join, normalize } from 'pathe';
5
- import { createLogicalPath } from '../paths/normalize';
6
- import { ROOT_COLLECTION_ID } from '../paths/types';
5
+ import { createLogicalPath } from '../paths/normalize.js';
6
+ import { ROOT_COLLECTION_ID } from '../paths/types.js';
7
7
  /**
8
8
  * Normalize a path value by splitting, filtering empty segments, and rejoining.
9
9
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helper functions for authoring CanopyCMS configuration files.
3
3
  */
4
- import { validateCanopyConfig } from './validation';
4
+ import { validateCanopyConfig } from './validation.js';
5
5
  /**
6
6
  * Helper for authoring typed config files (canopycms.config.ts).
7
7
  * Performs runtime validation using the CanopyConfig schema.
@@ -60,8 +60,8 @@ export function defineCanopyConfig(config) {
60
60
  *
61
61
  * // canopycms.config.ts
62
62
  * import { composeCanopyConfig } from 'canopycms'
63
- * import { postsConfig } from './posts.config'
64
- * import { pagesConfig } from './pages.config'
63
+ * import { postsConfig } from './posts.config.js'
64
+ * import { pagesConfig } from './pages.config.js'
65
65
  *
66
66
  * export const config = composeCanopyConfig(postsConfig, pagesConfig)
67
67
  * ```
@@ -9,15 +9,15 @@
9
9
  * ```
10
10
  */
11
11
  // Re-export type constants
12
- export { primitiveFieldTypes, fieldTypes } from './types';
12
+ export { primitiveFieldTypes, fieldTypes } from './types.js';
13
13
  // Re-export schemas (for advanced use cases)
14
- export { CanopyConfigSchema, getConfigDefaults, DEFAULT_PROD_WORKSPACE } from './schemas/config';
15
- export { fieldSchema, blockSchema, selectOptionSchema, referenceOptionSchema, } from './schemas/field';
16
- export { collectionSchema, rootCollectionSchema, entryTypeSchema, relativePathSchema, } from './schemas/collection';
17
- export { permissionTargetSchema, pathPermissionSchema } from './schemas/permissions';
18
- export { mediaSchema } from './schemas/media';
14
+ export { CanopyConfigSchema, getConfigDefaults, DEFAULT_PROD_WORKSPACE } from './schemas/config.js';
15
+ export { fieldSchema, blockSchema, selectOptionSchema, referenceOptionSchema, } from './schemas/field.js';
16
+ export { collectionSchema, rootCollectionSchema, entryTypeSchema, relativePathSchema, } from './schemas/collection.js';
17
+ export { permissionTargetSchema, pathPermissionSchema } from './schemas/permissions.js';
18
+ export { mediaSchema } from './schemas/media.js';
19
19
  // Re-export utilities
20
- export { flattenSchema, normalizePathValue, normalizeSchemaPathsRoot } from './flatten';
21
- export { validateCanopyConfig, ensureSelectFieldsHaveOptions } from './validation';
22
- export { defineCanopyConfig, composeCanopyConfig } from './helpers';
20
+ export { flattenSchema, normalizePathValue, normalizeSchemaPathsRoot } from './flatten.js';
21
+ export { validateCanopyConfig, ensureSelectFieldsHaveOptions } from './validation.js';
22
+ export { defineCanopyConfig, composeCanopyConfig } from './helpers.js';
23
23
  //# sourceMappingURL=index.js.map
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { z } from 'zod';
5
5
  import { isAbsolute } from 'pathe';
6
- import { fieldSchema } from './field';
6
+ import { fieldSchema } from './field.js';
7
7
  // Relative path schema - validates and normalizes paths
8
8
  export const relativePathSchema = z
9
9
  .string()
@@ -2,8 +2,8 @@
2
2
  * Main CanopyConfig Zod schema - composes all sub-schemas.
3
3
  */
4
4
  import { z } from 'zod';
5
- import { rootCollectionSchema, relativePathSchema } from './collection';
6
- import { mediaSchema } from './media';
5
+ import { rootCollectionSchema, relativePathSchema } from './collection.js';
6
+ import { mediaSchema } from './media.js';
7
7
  // Default value schemas
8
8
  export const defaultBranchAccessSchema = z.enum(['allow', 'deny']).default('deny');
9
9
  export const defaultPathAccessSchema = z.enum(['allow', 'deny']).default('deny');
@@ -2,7 +2,7 @@
2
2
  * Zod schemas for field configuration validation.
3
3
  */
4
4
  import { z } from 'zod';
5
- import { primitiveFieldTypes, fieldTypes } from '../types';
5
+ import { primitiveFieldTypes, fieldTypes } from '../types.js';
6
6
  // Base field schema - shared properties
7
7
  export const fieldBaseSchema = z.object({
8
8
  name: z.string().min(1),
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Configuration validation utilities.
3
3
  */
4
- import { CanopyConfigSchema } from './schemas/config';
5
- import { normalizePathValue, normalizeSchemaPathsRoot } from './flatten';
4
+ import { CanopyConfigSchema } from './schemas/config.js';
5
+ import { normalizePathValue, normalizeSchemaPathsRoot } from './flatten.js';
6
6
  /**
7
7
  * Recursively check that all select fields have options defined.
8
8
  * Throws an error if a select field is missing options.
@@ -1,5 +1,5 @@
1
- import { defineCanopyConfig, flattenSchema } from './config';
2
- import { createTestCanopyServices, } from './services';
1
+ import { defineCanopyConfig, flattenSchema } from './config/index.js';
2
+ import { createTestCanopyServices, } from './services.js';
3
3
  const FALLBACK_AUTHOR = {
4
4
  gitBotAuthorName: 'CanopyCMS Test Bot',
5
5
  gitBotAuthorEmail: 'canopycms-test@example.com',
package/dist/config.js CHANGED
@@ -2,10 +2,10 @@
2
2
  * CanopyCMS Configuration
3
3
  *
4
4
  * This file re-exports from the config module for backward compatibility.
5
- * New code should import directly from './config/index' or './config'.
5
+ * New code should import directly from './config/index.js' or './config'.
6
6
  *
7
7
  * @module config
8
8
  */
9
9
  // Re-export everything from the config module
10
- export * from './config/index';
10
+ export * from './config/index.js';
11
11
  //# sourceMappingURL=config.js.map
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { isValidId } from './id';
4
- import { isNotFoundError } from './utils/error';
3
+ import { isValidId } from './id.js';
4
+ import { isNotFoundError } from './utils/error.js';
5
5
  /** Logical path representing entries stored at the branch root (no parent collection). Rare in practice. */
6
6
  const EMPTY_LOGICAL_PATH = '';
7
7
  /**
@@ -6,13 +6,13 @@
6
6
  import fs from 'node:fs/promises';
7
7
  import path from 'node:path';
8
8
  import matter from 'gray-matter';
9
- import { getFormatExtension } from './utils/format';
10
- import { resolveCollectionPath } from './content-id-index';
11
- import { validateAndNormalizePath } from './paths';
12
- import { isNotFoundError, getErrorMessage } from './utils/error';
13
- import { createDebugLogger } from './utils/debug';
14
- import { isValidId } from './id';
15
- import { ContentStoreError } from './content-store';
9
+ import { getFormatExtension } from './utils/format.js';
10
+ import { resolveCollectionPath } from './content-id-index.js';
11
+ import { validateAndNormalizePath } from './paths/index.js';
12
+ import { isNotFoundError, getErrorMessage } from './utils/error.js';
13
+ import { createDebugLogger } from './utils/debug.js';
14
+ import { isValidId } from './id.js';
15
+ import { ContentStoreError } from './content-store.js';
16
16
  const log = createDebugLogger({ prefix: 'ContentListing' });
17
17
  /**
18
18
  * Validate and normalize a path relative to root.
@@ -1,8 +1,8 @@
1
- import { loadBranchContext, loadOrCreateBranchContext } from './branch-workspace';
2
- import { ContentStore, ContentStoreError } from './content-store';
3
- import { resolveBranchPaths } from './paths';
4
- import { isDeployedStatic, isBuildMode } from './build-mode';
5
- import { isNotFoundError } from './utils/error';
1
+ import { loadBranchContext, loadOrCreateBranchContext } from './branch-workspace.js';
2
+ import { ContentStore, ContentStoreError } from './content-store.js';
3
+ import { resolveBranchPaths } from './paths/index.js';
4
+ import { isDeployedStatic, isBuildMode } from './build-mode.js';
5
+ import { isNotFoundError } from './utils/error.js';
6
6
  /**
7
7
  * Server-side helper to read content directly from a branch workspace.
8
8
  * Falls back to creating the branch workspace (metadata + checkout) if missing.
@@ -1,11 +1,11 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import matter from 'gray-matter';
4
- import { atomicWriteFile } from './utils/atomic-write';
5
- import { ContentIdIndex, extractIdFromFilename, extractSlugFromFilename, extractEntryTypeFromFilename, resolveCollectionPath, } from './content-id-index';
6
- import { generateId } from './id';
7
- import { getFormatExtension } from './utils/format';
8
- import { normalizeFilesystemPath, } from './paths';
4
+ import { atomicWriteFile } from './utils/atomic-write.js';
5
+ import { ContentIdIndex, extractIdFromFilename, extractSlugFromFilename, extractEntryTypeFromFilename, resolveCollectionPath, } from './content-id-index.js';
6
+ import { generateId } from './id.js';
7
+ import { getFormatExtension } from './utils/format.js';
8
+ import { normalizeFilesystemPath, } from './paths/index.js';
9
9
  export class ContentStoreError extends Error {
10
10
  }
11
11
  /**
@@ -8,7 +8,7 @@
8
8
  * metadata, entry metadata). Display concerns like labels are left to the
9
9
  * adopter via the `extract` callback.
10
10
  */
11
- import { listCollectionEntries, sortByOrder } from './content-listing';
11
+ import { listCollectionEntries, sortByOrder } from './content-listing.js';
12
12
  /** Group flat schema items by parentPath for O(1) child lookup. */
13
13
  const groupByParent = (flat) => {
14
14
  const map = new Map();
package/dist/context.js CHANGED
@@ -1,9 +1,9 @@
1
- import { isDeployedStatic, isBuildMode, STATIC_DEPLOY_USER } from './build-mode';
2
- import { createContentReader } from './content-reader';
3
- import { createLogicalPath, parseSlug, resolveBranchPaths } from './paths';
4
- import { loadOrCreateBranchContext } from './branch-workspace';
5
- import { buildContentTree as buildContentTreeImpl, } from './content-tree';
6
- import { listEntries as listEntriesImpl, } from './content-listing';
1
+ import { isDeployedStatic, isBuildMode, STATIC_DEPLOY_USER } from './build-mode.js';
2
+ import { createContentReader } from './content-reader.js';
3
+ import { createLogicalPath, parseSlug, resolveBranchPaths } from './paths/index.js';
4
+ import { loadOrCreateBranchContext } from './branch-workspace.js';
5
+ import { buildContentTree as buildContentTreeImpl, } from './content-tree.js';
6
+ import { listEntries as listEntriesImpl, } from './content-listing.js';
7
7
  /**
8
8
  * Create a Canopy context that manages auth + content reading.
9
9
  * Framework-agnostic - the adapter provides the extractUser function.
@@ -2,11 +2,11 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
4
  import { Badge, Button, Group, Paper, ScrollArea, Stack, Text, TextInput, Textarea, Collapse, Tooltip, } from '@mantine/core';
5
- import { BranchComments } from './comments/BranchComments';
6
- import { UserBadge } from './components/UserBadge';
5
+ import { BranchComments } from './comments/BranchComments.js';
6
+ import { UserBadge } from './components/UserBadge.js';
7
7
  // Import directly from helpers to avoid server-only code in authorization barrel
8
- import { isAdmin, isReviewer } from '../authorization/helpers';
9
- import { clientOperatingStrategy } from '../operating-mode/client';
8
+ import { isAdmin, isReviewer } from '../authorization/helpers.js';
9
+ import { clientOperatingStrategy } from '../operating-mode/client.js';
10
10
  /**
11
11
  * Compute what actions the current user can perform on a branch.
12
12
  * Uses the same hybrid permission model as the backend:
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo } from 'react';
4
- import { Editor } from './Editor';
5
- import { ApiClientProvider } from './context';
6
- import { buildEditorCollections, buildPreviewBaseByCollection } from './editor-config';
4
+ import { Editor } from './Editor.js';
5
+ import { ApiClientProvider } from './context/index.js';
6
+ import { buildEditorCollections, buildPreviewBaseByCollection } from './editor-config.js';
7
7
  export const CanopyEditor = ({ config, entries = [], initialSelectedId, initialValues, renderPreview, onCreateEntry, branchName, }) => {
8
8
  const collections = useMemo(() => buildEditorCollections(config.flatSchema), [config.flatSchema]);
9
9
  const previewBase = useMemo(() => ({
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CanopyEditor } from './CanopyEditor';
2
+ import { CanopyEditor } from './CanopyEditor.js';
3
3
  export const CanopyEditorPage = (config) => {
4
4
  const CanopyEditorPageInner = ({ searchParams, }) => {
5
5
  const branchName = searchParams?.branch ?? config.defaultBaseBranch ?? 'main';
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
4
  import { Badge, Button, Drawer, Group, Paper, ScrollArea, Stack, Text, Textarea, Title, Switch, } from '@mantine/core';
5
- import { UserBadge } from './components/UserBadge';
5
+ import { UserBadge } from './components/UserBadge.js';
6
6
  export const CommentsPanel = ({ branchName, comments, canResolve, onAddComment, onResolveThread, onClose, onJumpToField, onJumpToEntry, onJumpToBranch, onGetUserMetadata, }) => {
7
7
  const [newCommentText, setNewCommentText] = useState('');
8
8
  const [replyTo, setReplyTo] = useState(null);
@@ -4,24 +4,24 @@ import { useEffect, useMemo, useState, useRef } from 'react';
4
4
  import { ActionIcon, Box, Drawer, Group, Menu, Paper, Text, Title } from '@mantine/core';
5
5
  import { IconChevronDown, IconChevronUp, IconDots, IconFolderPlus, IconPlus, } from '@tabler/icons-react';
6
6
  import { notifications } from '@mantine/notifications';
7
- import { EntryNavigator } from './EntryNavigator';
8
- import { FormRenderer } from './FormRenderer';
9
- import { PreviewFrame } from './preview-bridge';
10
- import { EditorPanes } from './EditorPanes';
11
- import { CanopyCMSProvider } from './theme';
12
- import { BranchManager } from './BranchManager';
13
- import { CommentsPanel } from './CommentsPanel';
14
- import { GroupManager } from './GroupManager';
15
- import { PermissionManager } from './PermissionManager';
16
- import { buildPreviewSrc, buildCollectionLabels, buildBreadcrumbSegments } from './editor-utils';
17
- import { useEditorLayout, useDraftManager, useEntryManager, useGroupManager, usePermissionManager, useCommentSystem, useBranchManager, useUserContext, useSchemaManager, } from './hooks';
18
- import { useBranchActions } from './hooks/useBranchActions';
19
- import { EditorFooter, EditorHeader, EditorSidebar } from './components';
20
- import { RenameEntryModal } from './components/RenameEntryModal';
21
- import { EntryCreateModal } from './components/EntryCreateModal';
22
- import { ConfirmDeleteModal } from './components/ConfirmDeleteModal';
23
- import { CollectionEditor } from './schema-editor';
24
- import { useApiClient } from './context';
7
+ import { EntryNavigator } from './EntryNavigator.js';
8
+ import { FormRenderer } from './FormRenderer.js';
9
+ import { PreviewFrame } from './preview-bridge.js';
10
+ import { EditorPanes } from './EditorPanes.js';
11
+ import { CanopyCMSProvider } from './theme.js';
12
+ import { BranchManager } from './BranchManager.js';
13
+ import { CommentsPanel } from './CommentsPanel.js';
14
+ import { GroupManager } from './GroupManager.js';
15
+ import { PermissionManager } from './PermissionManager.js';
16
+ import { buildPreviewSrc, buildCollectionLabels, buildBreadcrumbSegments } from './editor-utils.js';
17
+ import { useEditorLayout, useDraftManager, useEntryManager, useGroupManager, usePermissionManager, useCommentSystem, useBranchManager, useUserContext, useSchemaManager, } from './hooks/index.js';
18
+ import { useBranchActions } from './hooks/useBranchActions.js';
19
+ import { EditorFooter, EditorHeader, EditorSidebar } from './components/index.js';
20
+ import { RenameEntryModal } from './components/RenameEntryModal.js';
21
+ import { EntryCreateModal } from './components/EntryCreateModal.js';
22
+ import { ConfirmDeleteModal } from './components/ConfirmDeleteModal.js';
23
+ import { CollectionEditor } from './schema-editor/index.js';
24
+ import { useApiClient } from './context/index.js';
25
25
  /**
26
26
  * High-level editor wrapper that wires entry navigation, form rendering,
27
27
  * saving/loading, and preview rendering using entry definitions.
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useMemo, useRef, useEffect } from 'react';
4
4
  import { ActionIcon, Badge, Box, Group, Menu, ScrollArea, Stack, Text, Tooltip, Tree, useTree, rem, } from '@mantine/core';
5
5
  import { IconArrowDown, IconArrowUp, IconDots, IconEdit, IconFolderPlus, IconPlus, IconTrash, } from '@tabler/icons-react';
6
- import { calculatePathToEntry } from './editor-utils';
6
+ import { calculatePathToEntry } from './editor-utils.js';
7
7
  export const EntryNavigator = ({ items, collections, selectedPath, onSelect, onTreeControllerReady, expandedStateRef, onExpandedStateChange, onDeleteEntry, onRenameEntry, onReorderEntry, hiddenRootPath, }) => {
8
8
  const selectedNodeRef = useRef(null);
9
9
  const hasScrolledRef = useRef(false);
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Alert, Button, Group, Paper, Stack, Text } from '@mantine/core';
3
3
  import { IconInfoCircle } from '@tabler/icons-react';
4
- import { MarkdownField } from './fields/MarkdownField';
5
- import { TextField } from './fields/TextField';
6
- import { ToggleField } from './fields/ToggleField';
7
- import { BlockField } from './fields/BlockField';
8
- import { SelectField } from './fields/SelectField';
9
- import { ReferenceField } from './fields/ReferenceField';
10
- import { CodeField } from './fields/CodeField';
11
- import { ObjectField } from './fields/ObjectField';
12
- import { formatCanopyPath, normalizeCanopyPath } from './canopy-path';
13
- import { FieldWrapper } from './comments/FieldWrapper';
14
- import { EntryComments } from './comments/EntryComments';
15
- import { useReferenceResolution } from './hooks/useReferenceResolution';
4
+ import { MarkdownField } from './fields/MarkdownField.js';
5
+ import { TextField } from './fields/TextField.js';
6
+ import { ToggleField } from './fields/ToggleField.js';
7
+ import { BlockField } from './fields/BlockField.js';
8
+ import { SelectField } from './fields/SelectField.js';
9
+ import { ReferenceField } from './fields/ReferenceField.js';
10
+ import { CodeField } from './fields/CodeField.js';
11
+ import { ObjectField } from './fields/ObjectField.js';
12
+ import { formatCanopyPath, normalizeCanopyPath } from './canopy-path.js';
13
+ import { FieldWrapper } from './comments/FieldWrapper.js';
14
+ import { EntryComments } from './comments/EntryComments.js';
15
+ import { useReferenceResolution } from './hooks/useReferenceResolution.js';
16
16
  const normalizeOptions = (options) => {
17
17
  if (!options)
18
18
  return [];
@@ -3,5 +3,5 @@
3
3
  * GroupManager - Re-exports from the group-manager module.
4
4
  * This file maintains backward compatibility with existing imports.
5
5
  */
6
- export { GroupManager, useGroupState, useUserSearch, useExternalGroupSearch } from './group-manager';
6
+ export { GroupManager, useGroupState, useUserSearch, useExternalGroupSearch } from './group-manager/index.js';
7
7
  //# sourceMappingURL=GroupManager.js.map
@@ -5,5 +5,5 @@
5
5
  * This file maintains backward compatibility for imports.
6
6
  * The actual implementation is in ./permission-manager/
7
7
  */
8
- export { PermissionManager, usePermissionTree, useGroupsAndUsers } from './permission-manager';
8
+ export { PermissionManager, usePermissionTree, useGroupsAndUsers } from './permission-manager/index.js';
9
9
  //# sourceMappingURL=PermissionManager.js.map
@@ -1,4 +1,4 @@
1
- import { createApiClient } from '../api/client';
1
+ import { createApiClient } from '../api/client.js';
2
2
  /**
3
3
  * Client-side utility for incrementally resolving reference fields in form data.
4
4
  * Used by FormRenderer to transform draft data before sending to preview.
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from 'react';
4
4
  import { Box, Button } from '@mantine/core';
5
- import { ThreadCarousel } from './ThreadCarousel';
5
+ import { ThreadCarousel } from './ThreadCarousel.js';
6
6
  /**
7
7
  * Branch-level comments section displayed at the top of BranchManager.
8
8
  * Uses ThreadCarousel for navigation.
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from 'react';
4
4
  import { Box, Button } from '@mantine/core';
5
- import { ThreadCarousel } from './ThreadCarousel';
5
+ import { ThreadCarousel } from './ThreadCarousel.js';
6
6
  /**
7
7
  * Entry-level comments section displayed at the top of the form.
8
8
  * Uses ThreadCarousel for navigation.
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef, useState } from 'react';
4
4
  import { Box, Button } from '@mantine/core';
5
- import { ThreadCarousel } from './ThreadCarousel';
5
+ import { ThreadCarousel } from './ThreadCarousel.js';
6
6
  /**
7
7
  * Wraps a form field with inline comment functionality.
8
8
  * Shows ThreadCarousel when comments exist or when user clicks "New comment".
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
4
  import { Alert, Badge, Button, Group, Paper, Stack, Text, Textarea } from '@mantine/core';
5
5
  import { IconAlertCircle } from '@tabler/icons-react';
6
- import { UserBadge } from '../components/UserBadge';
6
+ import { UserBadge } from '../components/UserBadge.js';
7
7
  /**
8
8
  * Individual comment thread display within the carousel.
9
9
  * Always shows full thread view with per-thread scrolling.
@@ -3,7 +3,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useState, useMemo, useEffect, useRef } from 'react';
4
4
  import { ActionIcon, Alert, Button, Group, Paper, Stack, Text, Textarea } from '@mantine/core';
5
5
  import { IconChevronLeft, IconChevronRight, IconAlertCircle } from '@tabler/icons-react';
6
- import { InlineCommentThread } from './InlineCommentThread';
6
+ import { InlineCommentThread } from './InlineCommentThread.js';
7
7
  export const ThreadCarousel = ({ threads, label = 'Comments', contextType: _, currentUserId, canResolve, onAddComment, onResolveThread, autoFocus, autoOpenNewThread, highlightThreadId, onGetUserMetadata, }) => {
8
8
  const [currentIndex, setCurrentIndex] = useState(0);
9
9
  const [showNewThreadBox, setShowNewThreadBox] = useState(false);