@opensaas/stack-tiptap 0.39.2 → 0.41.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.
@@ -1,11 +1,11 @@
1
1
 
2
- > @opensaas/stack-tiptap@0.39.2 build /home/runner/work/stack/stack/packages/tiptap
2
+ > @opensaas/stack-tiptap@0.41.0 build /home/runner/work/stack/stack/packages/tiptap
3
3
  > tsc && npm run copy:css
4
4
 
5
5
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
6
6
  npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
7
7
  npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
8
8
 
9
- > @opensaas/stack-tiptap@0.39.2 copy:css
9
+ > @opensaas/stack-tiptap@0.41.0 copy:css
10
10
  > mkdir -p dist/styles && cp src/styles/tiptap.css dist/styles/
11
11
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @opensaas/stack-tiptap
2
2
 
3
+ ## 0.41.0
4
+
5
+ ## 0.40.0
6
+
7
+ ### Patch Changes
8
+
9
+ - [#973](https://github.com/OpenSaasAU/stack/pull/973) [`8f76533`](https://github.com/OpenSaasAU/stack/commit/8f765333e3067c741c69f535927cc82115c60ed1) Thanks [@borisno2](https://github.com/borisno2)! - Comment cleanup only, no behavior change: removed restating/narration comments, kept TSDoc on public config options and field builders, and kept external API/behavior constraint notes (Prisma, S3, Vercel Blob, Keystone parity, Next.js SSR, Zod).
10
+
3
11
  ## 0.39.2
4
12
 
5
13
  ## 0.39.1
@@ -1 +1 @@
1
- {"version":3,"file":"TiptapField.d.ts","sourceRoot":"","sources":["../../src/components/TiptapField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAI1E,OAAO,sBAAsB,CAAA;AAE7B,MAAM,WAAW,g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AAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,IAAa,EACb,WAAgC,EAChC,SAAe,EACf,SAAS,GACV,EAAE,gBAAgB,2CAqJlB"}
@@ -37,13 +37,11 @@ export function TiptapField({ name, value, onChange, label, error, disabled, req
37
37
  },
38
38
  },
39
39
  });
40
- // Update content when value changes externally
41
40
  useEffect(() => {
42
41
  if (editor && value !== editor.getJSON()) {
43
42
  editor.commands.setContent(value || '');
44
43
  }
45
44
  }, [editor, value]);
46
- // Update editable state when mode or disabled changes
47
45
  useEffect(() => {
48
46
  if (editor) {
49
47
  editor.setEditable(isEditable);
@@ -9,25 +9,15 @@ export type RichTextField<TTypeInfo extends TypeInfo = TypeInfo> = BaseFieldConf
9
9
  isRequired?: boolean;
10
10
  };
11
11
  ui?: {
12
- /**
13
- * Placeholder text for empty editor
14
- */
12
+ /** Placeholder text for empty editor */
15
13
  placeholder?: string;
16
- /**
17
- * Minimum height for editor in pixels
18
- */
14
+ /** Minimum height for editor in pixels */
19
15
  minHeight?: number;
20
- /**
21
- * Maximum height for editor in pixels
22
- */
16
+ /** Maximum height for editor in pixels */
23
17
  maxHeight?: number;
24
- /**
25
- * Custom React component to render this field
26
- */
18
+ /** Custom React component to render this field */
27
19
  component?: any;
28
- /**
29
- * Custom field type name to use from the global registry
30
- */
20
+ /** Custom field type name to use from the global registry */
31
21
  fieldType?: string;
32
22
  };
33
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAE5E;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG;IAC9F,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,EAAE,CAAC,EAAE;QACH;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB;;WAEG;QAEH,SAAS,CAAC,EAAE,GAAG,CAAA;QACf;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAE5E;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG;IAC9F,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,EAAE,CAAC,EAAE;QACH,wCAAwC;QACxC,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,0CAA0C;QAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,0CAA0C;QAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,kDAAkD;QAElD,SAAS,CAAC,EAAE,GAAG,CAAA;QACf,6DAA6D;QAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"richText.d.ts","sourceRoot":"","sources":["../../src/fields/richText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,aAAa,CAwC7E"}
1
+ {"version":3,"file":"richText.d.ts","sourceRoot":"","sources":["../../src/fields/richText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,aAAa,CAsC7E"}
@@ -25,19 +25,17 @@ export function richText(options) {
25
25
  getZodSchema: (fieldName, operation) => {
26
26
  const validation = options?.validation;
27
27
  const isRequired = validation?.isRequired;
28
- // Accept any valid JSON structure from Tiptap
29
- // Tiptap outputs JSONContent which is a complex nested structure
28
+ // Tiptap emits a complex nested JSONContent structure; accept any valid JSON.
30
29
  const baseSchema = z.any();
31
30
  if (isRequired && operation === 'create') {
32
- // For create, reject undefined
31
+ // Reject undefined on create.
33
32
  return baseSchema;
34
33
  }
35
34
  else if (isRequired && operation === 'update') {
36
- // For update, allow undefined (partial updates)
35
+ // Allow undefined on update (partial updates).
37
36
  return z.union([baseSchema, z.undefined()]);
38
37
  }
39
38
  else {
40
- // Not required
41
39
  return baseSchema.optional();
42
40
  }
43
41
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensaas/stack-tiptap",
3
- "version": "0.39.2",
3
+ "version": "0.41.0",
4
4
  "description": "Tiptap rich text editor integration for OpenSaas Stack",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@tiptap/extension-placeholder": "^3.29.2",
45
- "@tiptap/pm": "^3.28.0",
45
+ "@tiptap/pm": "^3.30.2",
46
46
  "@tiptap/react": "^3.29.2",
47
47
  "@tiptap/starter-kit": "^3.28.0",
48
48
  "zod": "^4.4.3"
@@ -56,8 +56,8 @@
56
56
  "react": "^19.2.8",
57
57
  "react-dom": "^19.2.8",
58
58
  "typescript": "npm:@typescript/typescript6@^6.0.2",
59
- "@opensaas/stack-core": "0.39.2",
60
- "@opensaas/stack-ui": "0.39.2"
59
+ "@opensaas/stack-core": "0.41.0",
60
+ "@opensaas/stack-ui": "0.41.0"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "tsc && npm run copy:css",
@@ -66,14 +66,12 @@ export function TiptapField({
66
66
  },
67
67
  })
68
68
 
69
- // Update content when value changes externally
70
69
  useEffect(() => {
71
70
  if (editor && value !== editor.getJSON()) {
72
71
  editor.commands.setContent(value || '')
73
72
  }
74
73
  }, [editor, value])
75
74
 
76
- // Update editable state when mode or disabled changes
77
75
  useEffect(() => {
78
76
  if (editor) {
79
77
  editor.setEditable(isEditable)
@@ -98,9 +96,7 @@ export function TiptapField({
98
96
  {required && <span className="text-destructive">*</span>}
99
97
  </label>
100
98
 
101
- {/* Editor with toolbar */}
102
99
  <div className={`tiptap-editor ${error ? 'border-destructive' : ''}`}>
103
- {/* Toolbar */}
104
100
  {isEditable && editor && (
105
101
  <div className="tiptap-toolbar">
106
102
  <button
@@ -174,7 +170,6 @@ export function TiptapField({
174
170
  </div>
175
171
  )}
176
172
 
177
- {/* Editor content */}
178
173
  <div
179
174
  className={disabled ? 'opacity-50 cursor-not-allowed' : ''}
180
175
  style={{
@@ -10,26 +10,16 @@ export type RichTextField<TTypeInfo extends TypeInfo = TypeInfo> = BaseFieldConf
10
10
  isRequired?: boolean
11
11
  }
12
12
  ui?: {
13
- /**
14
- * Placeholder text for empty editor
15
- */
13
+ /** Placeholder text for empty editor */
16
14
  placeholder?: string
17
- /**
18
- * Minimum height for editor in pixels
19
- */
15
+ /** Minimum height for editor in pixels */
20
16
  minHeight?: number
21
- /**
22
- * Maximum height for editor in pixels
23
- */
17
+ /** Maximum height for editor in pixels */
24
18
  maxHeight?: number
25
- /**
26
- * Custom React component to render this field
27
- */
19
+ /** Custom React component to render this field */
28
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
21
  component?: any
30
- /**
31
- * Custom field type name to use from the global registry
32
- */
22
+ /** Custom field type name to use from the global registry */
33
23
  fieldType?: string
34
24
  }
35
25
  }
@@ -28,18 +28,16 @@ export function richText(options?: Omit<RichTextField, 'type'>): RichTextField {
28
28
  const validation = options?.validation
29
29
  const isRequired = validation?.isRequired
30
30
 
31
- // Accept any valid JSON structure from Tiptap
32
- // Tiptap outputs JSONContent which is a complex nested structure
31
+ // Tiptap emits a complex nested JSONContent structure; accept any valid JSON.
33
32
  const baseSchema = z.any()
34
33
 
35
34
  if (isRequired && operation === 'create') {
36
- // For create, reject undefined
35
+ // Reject undefined on create.
37
36
  return baseSchema
38
37
  } else if (isRequired && operation === 'update') {
39
- // For update, allow undefined (partial updates)
38
+ // Allow undefined on update (partial updates).
40
39
  return z.union([baseSchema, z.undefined()])
41
40
  } else {
42
- // Not required
43
41
  return baseSchema.optional()
44
42
  }
45
43
  },