@tldraw/editor 4.1.0-canary.1074d3722187 → 4.1.0-canary.258eb40641af

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 (46) hide show
  1. package/dist-cjs/index.d.ts +9 -0
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/lib/TldrawEditor.js +2 -2
  4. package/dist-cjs/lib/components/ErrorBoundary.js +1 -1
  5. package/dist-cjs/lib/components/HTMLContainer.js +1 -1
  6. package/dist-cjs/lib/components/SVGContainer.js +1 -1
  7. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +1 -1
  8. package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +1 -1
  9. package/dist-cjs/lib/components/default-components/DefaultCursor.js +1 -1
  10. package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +1 -1
  11. package/dist-cjs/lib/components/default-components/DefaultHandle.js +1 -1
  12. package/dist-cjs/lib/components/default-components/DefaultScribble.js +1 -1
  13. package/dist-cjs/lib/components/default-components/DefaultSelectionBackground.js +1 -1
  14. package/dist-cjs/lib/components/default-components/DefaultSelectionForeground.js +1 -1
  15. package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +1 -1
  16. package/dist-cjs/lib/components/default-components/DefaultShapeWrapper.js +1 -1
  17. package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js +2 -2
  18. package/dist-cjs/lib/components/default-components/DefaultSpinner.js +1 -1
  19. package/dist-cjs/lib/editor/Editor.js +1 -1
  20. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  21. package/dist-cjs/lib/hooks/useDarkMode.js +1 -1
  22. package/dist-cjs/lib/hooks/useEditor.js +1 -1
  23. package/dist-cjs/lib/hooks/useGestureEvents.js +1 -1
  24. package/dist-cjs/lib/hooks/useHandleEvents.js +1 -1
  25. package/dist-cjs/lib/hooks/useZoomCss.js +1 -1
  26. package/dist-cjs/lib/license/LicenseManager.js +14 -6
  27. package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
  28. package/dist-cjs/lib/license/Watermark.js +4 -4
  29. package/dist-cjs/lib/license/Watermark.js.map +1 -1
  30. package/dist-cjs/version.js +3 -3
  31. package/dist-cjs/version.js.map +1 -1
  32. package/dist-esm/index.d.mts +9 -0
  33. package/dist-esm/index.mjs +1 -1
  34. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  35. package/dist-esm/lib/license/LicenseManager.mjs +14 -6
  36. package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
  37. package/dist-esm/lib/license/Watermark.mjs +4 -4
  38. package/dist-esm/lib/license/Watermark.mjs.map +1 -1
  39. package/dist-esm/version.mjs +3 -3
  40. package/dist-esm/version.mjs.map +1 -1
  41. package/editor.css +7 -2
  42. package/package.json +7 -7
  43. package/src/lib/editor/shapes/ShapeUtil.ts +10 -0
  44. package/src/lib/license/LicenseManager.ts +14 -6
  45. package/src/lib/license/Watermark.tsx +4 -4
  46. package/src/version.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
3
  "description": "tldraw infinite canvas SDK (editor).",
4
- "version": "4.1.0-canary.1074d3722187",
4
+ "version": "4.1.0-canary.258eb40641af",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -50,12 +50,12 @@
50
50
  "@tiptap/core": "^2.9.1",
51
51
  "@tiptap/pm": "^2.9.1",
52
52
  "@tiptap/react": "^2.9.1",
53
- "@tldraw/state": "4.1.0-canary.1074d3722187",
54
- "@tldraw/state-react": "4.1.0-canary.1074d3722187",
55
- "@tldraw/store": "4.1.0-canary.1074d3722187",
56
- "@tldraw/tlschema": "4.1.0-canary.1074d3722187",
57
- "@tldraw/utils": "4.1.0-canary.1074d3722187",
58
- "@tldraw/validate": "4.1.0-canary.1074d3722187",
53
+ "@tldraw/state": "4.1.0-canary.258eb40641af",
54
+ "@tldraw/state-react": "4.1.0-canary.258eb40641af",
55
+ "@tldraw/store": "4.1.0-canary.258eb40641af",
56
+ "@tldraw/tlschema": "4.1.0-canary.258eb40641af",
57
+ "@tldraw/utils": "4.1.0-canary.258eb40641af",
58
+ "@tldraw/validate": "4.1.0-canary.258eb40641af",
59
59
  "@types/core-js": "^2.5.8",
60
60
  "@use-gesture/react": "^10.3.1",
61
61
  "classnames": "^2.5.1",
@@ -328,6 +328,16 @@ export abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknownShape> {
328
328
  */
329
329
  shouldClipChild?(child: TLShape): boolean
330
330
 
331
+ /**
332
+ * Whether a specific shape should hide in the minimap.
333
+ *
334
+ * If not defined, the default behavior is to show all shapes in the minimap.
335
+ *
336
+ * @returns boolean indicating if this shape should hide in the minimap
337
+ * @public
338
+ */
339
+ hideInMinimap?(_shape: Shape): boolean
340
+
331
341
  /**
332
342
  * Whether the shape should hide its resize handles when selected.
333
343
  *
@@ -172,6 +172,9 @@ export class LicenseManager {
172
172
  if ('license' in result) {
173
173
  url.searchParams.set('license_id', result.license.id)
174
174
  }
175
+ if (process.env.NODE_ENV) {
176
+ url.searchParams.set('environment', process.env.NODE_ENV)
177
+ }
175
178
 
176
179
  // eslint-disable-next-line no-restricted-globals
177
180
  fetch(url.toString())
@@ -406,22 +409,27 @@ export class LicenseManager {
406
409
  // If we added a new flag it will be twice the value of the currently highest flag.
407
410
  // And if all the current flags are on we would get the `HIGHEST_FLAG * 2 - 1`, so anything higher than that means there are new flags.
408
411
  if (result.license.flags >= HIGHEST_FLAG * 2) {
409
- this.outputMessages([
410
- 'This tldraw license contains some unknown flags.',
411
- 'You may want to update tldraw packages to a newer version to get access to new functionality.',
412
- ])
412
+ this.outputMessages(
413
+ [
414
+ 'Warning: This tldraw license contains some unknown flags.',
415
+ 'This will still work, however, you may want to update tldraw packages to a newer version to get access to new functionality.',
416
+ ],
417
+ 'warning'
418
+ )
413
419
  }
414
420
  }
415
421
 
416
- private outputMessages(messages: string[]) {
422
+ private outputMessages(messages: string[], type: 'warning' | 'error' = 'error') {
417
423
  if (this.isTest) return
418
424
  if (this.verbose) {
419
425
  this.outputDelimiter()
420
426
  for (const message of messages) {
427
+ const color = type === 'warning' ? 'orange' : 'crimson'
428
+ const bgColor = type === 'warning' ? 'orange' : 'crimson'
421
429
  // eslint-disable-next-line no-console
422
430
  console.log(
423
431
  `%c${message}`,
424
- `color: white; background: crimson; padding: 2px; border-radius: 3px;`
432
+ `color: ${color}; background: ${bgColor}; padding: 2px; border-radius: 3px;`
425
433
  )
426
434
  }
427
435
  this.outputDelimiter()
@@ -208,22 +208,22 @@ To remove the watermark, please purchase a license at tldraw.dev.
208
208
  }
209
209
 
210
210
  @media (hover: hover) {
211
- .${className}[data-licensed='false'] > button {
211
+ .${className} > button {
212
212
  pointer-events: none;
213
213
  }
214
214
 
215
- .${className}[data-licensed='false']:hover {
215
+ .${className}:hover {
216
216
  background-color: var(--tl-color-background);
217
217
  transition: background-color 0.2s ease-in-out;
218
218
  transition-delay: 0.32s;
219
219
  }
220
220
 
221
- .${className}[data-licensed='false']:hover > button {
221
+ .${className}:hover > button {
222
222
  animation: ${className}_delayed_link 0.2s forwards ease-in-out;
223
223
  animation-delay: 0.32s;
224
224
  }
225
225
 
226
- .${className}[data-licensed='false'] > button:focus-visible {
226
+ .${className} > button:focus-visible {
227
227
  opacity: 1;
228
228
  }
229
229
  }
package/src/version.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '4.1.0-canary.1074d3722187'
4
+ export const version = '4.1.0-canary.258eb40641af'
5
5
  export const publishDates = {
6
6
  major: '2025-09-18T14:39:22.803Z',
7
- minor: '2025-09-19T08:55:09.699Z',
8
- patch: '2025-09-19T08:55:09.699Z',
7
+ minor: '2025-10-02T15:29:27.044Z',
8
+ patch: '2025-10-02T15:29:27.044Z',
9
9
  }