@tldraw/tlschema
Advanced tools
Comparing version 3.8.0-canary.fa7c40c0a965 to 3.8.0-canary.fb23b0ac9c3e
@@ -367,3 +367,3 @@ import { BaseRecord } from '@tldraw/store'; | ||
/** @public */ | ||
export declare const ImageShapeCrop: T.ObjectValidator<TLImageShapeCrop>; | ||
export declare const ImageShapeCrop: T.ObjectValidator<TLShapeCrop>; | ||
@@ -616,2 +616,9 @@ /** @public */ | ||
/** @public */ | ||
export declare type ShapeWithCrop = TLBaseShape<string, { | ||
crop: null | TLShapeCrop; | ||
h: number; | ||
w: number; | ||
}>; | ||
/** | ||
@@ -847,3 +854,6 @@ * A `StyleProp` is a property of a shape that follows some special rules. | ||
*/ | ||
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<string>; | ||
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<{ | ||
meta?: JsonObject; | ||
src: string; | ||
}>; | ||
/** | ||
@@ -1190,8 +1200,2 @@ * Resolve an asset to a URL. This is used when rendering the asset in the editor. By default, | ||
/** @public */ | ||
export declare interface TLImageShapeCrop { | ||
topLeft: VecModel; | ||
bottomRight: VecModel; | ||
} | ||
/** @public */ | ||
export declare interface TLImageShapeProps { | ||
@@ -1203,3 +1207,3 @@ w: number; | ||
assetId: null | TLAssetId; | ||
crop: null | TLImageShapeCrop; | ||
crop: null | TLShapeCrop; | ||
flipX: boolean; | ||
@@ -1483,2 +1487,8 @@ flipY: boolean; | ||
/** @public */ | ||
export declare interface TLShapeCrop { | ||
topLeft: VecModel; | ||
bottomRight: VecModel; | ||
} | ||
/** @public */ | ||
export declare type TLShapeId = RecordId<TLUnknownShape>; | ||
@@ -1485,0 +1495,0 @@ |
@@ -19,4 +19,4 @@ "use strict"; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
var index_exports = {}; | ||
__export(index_exports, { | ||
ArrowShapeArrowheadEndStyle: () => import_TLArrowShape.ArrowShapeArrowheadEndStyle, | ||
@@ -123,3 +123,3 @@ ArrowShapeArrowheadStartStyle: () => import_TLArrowShape.ArrowShapeArrowheadStartStyle, | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
module.exports = __toCommonJS(index_exports); | ||
var import_utils = require("@tldraw/utils"); | ||
@@ -174,5 +174,5 @@ var import_TLBaseAsset = require("./assets/TLBaseAsset"); | ||
"@tldraw/tlschema", | ||
"3.8.0-canary.fa7c40c0a965", | ||
"3.8.0-canary.fb23b0ac9c3e", | ||
"cjs" | ||
); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tldraw/tlschema", | ||
"description": "A tiny little drawing app (schema).", | ||
"version": "3.8.0-canary.fa7c40c0a965", | ||
"version": "3.8.0-canary.fb23b0ac9c3e", | ||
"author": { | ||
@@ -56,9 +56,10 @@ "name": "tldraw Inc.", | ||
"dependencies": { | ||
"@tldraw/state": "3.8.0-canary.fa7c40c0a965", | ||
"@tldraw/store": "3.8.0-canary.fa7c40c0a965", | ||
"@tldraw/utils": "3.8.0-canary.fa7c40c0a965", | ||
"@tldraw/validate": "3.8.0-canary.fa7c40c0a965" | ||
"@tldraw/state": "3.8.0-canary.fb23b0ac9c3e", | ||
"@tldraw/store": "3.8.0-canary.fb23b0ac9c3e", | ||
"@tldraw/utils": "3.8.0-canary.fb23b0ac9c3e", | ||
"@tldraw/validate": "3.8.0-canary.fb23b0ac9c3e" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
"react": "^18.2.0 || ^19.0.0", | ||
"react-dom": "^18.2.0 || ^19.0.0" | ||
}, | ||
@@ -65,0 +66,0 @@ "module": "dist-esm/index.mjs", |
@@ -136,2 +136,3 @@ import { registerTldrawLibraryVersion } from '@tldraw/utils' | ||
} from './recordsWithProps' | ||
export { type ShapeWithCrop, type TLShapeCrop } from './shapes/ShapeWithCrop' | ||
export { | ||
@@ -202,3 +203,2 @@ ArrowShapeArrowheadEndStyle, | ||
type TLImageShape, | ||
type TLImageShapeCrop, | ||
type TLImageShapeProps, | ||
@@ -205,0 +205,0 @@ } from './shapes/TLImageShape' |
import { T } from '@tldraw/validate' | ||
import { assetIdValidator } from '../assets/TLBaseAsset' | ||
import { VecModel, vecModelValidator } from '../misc/geometry-types' | ||
import { vecModelValidator } from '../misc/geometry-types' | ||
import { TLAssetId } from '../records/TLAsset' | ||
import { createShapePropsMigrationIds, createShapePropsMigrationSequence } from '../records/TLShape' | ||
import { RecordProps } from '../recordsWithProps' | ||
import { TLShapeCrop } from './ShapeWithCrop' | ||
import { TLBaseShape } from './TLBaseShape' | ||
/** @public */ | ||
export interface TLImageShapeCrop { | ||
topLeft: VecModel | ||
bottomRight: VecModel | ||
} | ||
/** @public */ | ||
export const ImageShapeCrop: T.ObjectValidator<TLImageShapeCrop> = T.object({ | ||
export const ImageShapeCrop: T.ObjectValidator<TLShapeCrop> = T.object({ | ||
topLeft: vecModelValidator, | ||
@@ -28,3 +23,3 @@ bottomRight: vecModelValidator, | ||
assetId: TLAssetId | null | ||
crop: TLImageShapeCrop | null | ||
crop: TLShapeCrop | null | ||
flipX: boolean | ||
@@ -31,0 +26,0 @@ flipY: boolean |
@@ -9,3 +9,3 @@ import { Signal } from '@tldraw/state' | ||
} from '@tldraw/store' | ||
import { IndexKey, annotateError, structuredClone } from '@tldraw/utils' | ||
import { IndexKey, JsonObject, annotateError, structuredClone } from '@tldraw/utils' | ||
import { TLAsset } from './records/TLAsset' | ||
@@ -101,3 +101,7 @@ import { CameraRecordType, TLCameraId } from './records/TLCamera' | ||
*/ | ||
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<string> | ||
upload( | ||
asset: TLAsset, | ||
file: File, | ||
abortSignal?: AbortSignal | ||
): Promise<{ src: string; meta?: JsonObject }> | ||
/** | ||
@@ -104,0 +108,0 @@ * Resolve an asset to a URL. This is used when rendering the asset in the editor. By default, |
@@ -15,3 +15,3 @@ import { LANGUAGES } from './languages' | ||
export function getDefaultTranslationLocale(): TLLanguage['locale'] { | ||
const locales = typeof window !== 'undefined' ? window.navigator.languages ?? ['en'] : ['en'] | ||
const locales = typeof window !== 'undefined' ? (window.navigator.languages ?? ['en']) : ['en'] | ||
return _getDefaultTranslationLocale(locales) | ||
@@ -18,0 +18,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1122382
294
18169
6
+ Added@tldraw/state@3.8.0-canary.fb23b0ac9c3e(transitive)
+ Added@tldraw/store@3.8.0-canary.fb23b0ac9c3e(transitive)
+ Added@tldraw/utils@3.8.0-canary.fb23b0ac9c3e(transitive)
+ Added@tldraw/validate@3.8.0-canary.fb23b0ac9c3e(transitive)
+ Addedreact@19.0.0(transitive)
+ Addedreact-dom@19.0.0(transitive)
+ Addedscheduler@0.25.0(transitive)
- Removed@tldraw/state@3.8.0-canary.fa7c40c0a965(transitive)
- Removed@tldraw/store@3.8.0-canary.fa7c40c0a965(transitive)
- Removed@tldraw/utils@3.8.0-canary.fa7c40c0a965(transitive)
- Removed@tldraw/validate@3.8.0-canary.fa7c40c0a965(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)