New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tldraw/tlschema

Package Overview
Dependencies
Maintainers
4
Versions
2235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tldraw/tlschema - npm Package Compare versions

Comparing version 3.8.0-canary.58beacd20b55 to 3.8.0-canary.591de9f26464

dist-cjs/shapes/ShapeWithCrop.js

99

dist-cjs/index.d.ts

@@ -367,3 +367,3 @@ import { BaseRecord } from '@tldraw/store';

/** @public */
export declare const ImageShapeCrop: T.ObjectValidator<TLImageShapeCrop>;
export declare const ImageShapeCrop: T.ObjectValidator<TLShapeCrop>;

@@ -405,2 +405,5 @@ /** @public */

}, {
readonly label: "Bahasa Melayu";
readonly locale: "ms";
}, {
readonly label: "Català";

@@ -424,2 +427,5 @@ readonly locale: "ca";

}, {
readonly label: "Filipino";
readonly locale: "tl";
}, {
readonly label: "Français";

@@ -440,2 +446,5 @@ readonly locale: "fr";

}, {
readonly label: "Nederlands";
readonly locale: "nl";
}, {
readonly label: "Norwegian";

@@ -456,5 +465,2 @@ readonly locale: "no";

}, {
readonly label: "Russian";
readonly locale: "ru";
}, {
readonly label: "Slovenščina";

@@ -478,3 +484,9 @@ readonly locale: "sl";

}, {
readonly label: "Ukrainian";
readonly label: "Ελληνικά";
readonly locale: "el";
}, {
readonly label: "Русский";
readonly locale: "ru";
}, {
readonly label: "Українська";
readonly locale: "uk";

@@ -485,2 +497,5 @@ }, {

}, {
readonly label: "اردو";
readonly locale: "ur";
}, {
readonly label: "عربي";

@@ -492,19 +507,37 @@ readonly locale: "ar";

}, {
readonly label: "کوردی";
readonly locale: "ku";
}, {
readonly label: "नेपाली";
readonly locale: "ne";
}, {
readonly label: "मराठी";
readonly locale: "mr";
}, {
readonly label: "हिन्दी";
readonly locale: "hi-in";
}, {
readonly label: "বাংলা";
readonly locale: "bn";
}, {
readonly label: "ਪੰਜਾਬੀ";
readonly locale: "pa";
}, {
readonly label: "ગુજરાતી";
readonly locale: "gu-in";
}, {
readonly label: "தமிழ்";
readonly locale: "ta";
}, {
readonly label: "తెలుగు";
readonly locale: "te";
}, {
readonly label: "ಕನ್ನಡ";
readonly locale: "kn";
}, {
readonly label: "മലയാളം";
readonly locale: "ml";
}, {
readonly label: "ภาษาไทย";
readonly locale: "th";
}, {
readonly label: "မြန်မာစာ";
readonly locale: "my";
readonly label: "ភាសាខ្មែរ";
readonly locale: "km-kh";
}, {

@@ -590,2 +623,9 @@ readonly label: "한국어";

/** @public */
export declare type ShapeWithCrop = TLBaseShape<string, {
crop: null | TLShapeCrop;
h: number;
w: number;
}>;
/**

@@ -754,6 +794,26 @@ * A `StyleProp` is a property of a shape that follows some special rules.

export declare interface TLAssetContext {
/**
* The scale at which the asset is being rendered on-screen relative to its native dimensions.
* If the asset is 1000px wide, but it's been resized/zoom so it takes 500px on-screen, this
* will be 0.5.
*
* The scale measures CSS pixels, not device pixels.
*/
screenScale: number;
/** The {@link TLAssetContext.screenScale}, stepped to the nearest power-of-2 multiple. */
steppedScreenScale: number;
/** The device pixel ratio - how many CSS pixels are in one device pixel? */
dpr: number;
/**
* An alias for
* {@link https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType | `navigator.connection.effectiveType` }
* if it's available in the current browser. Use this to e.g. serve lower-resolution images to
* users on slow connections.
*/
networkEffectiveType: null | string;
/**
* In some circumstances, we need to resolve a URL that points to the original version of a
* particular asset. This is used when the asset will leave the current tldraw instance - e.g.
* for copy/paste, or exports.
*/
shouldResolveToOriginal: boolean;

@@ -802,3 +862,6 @@ }

*/
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<string>;
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<{
meta?: JsonObject;
src: string;
}>;
/**

@@ -1145,8 +1208,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 {

@@ -1158,3 +1215,3 @@ w: number;

assetId: null | TLAssetId;
crop: null | TLImageShapeCrop;
crop: null | TLShapeCrop;
flipX: boolean;

@@ -1438,2 +1495,8 @@ flipY: boolean;

/** @public */
export declare interface TLShapeCrop {
topLeft: VecModel;
bottomRight: VecModel;
}
/** @public */
export declare type TLShapeId = RecordId<TLUnknownShape>;

@@ -1440,0 +1503,0 @@

8

dist-cjs/index.js

@@ -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.58beacd20b55",
"3.8.0-canary.591de9f26464",
"cjs"
);
//# sourceMappingURL=index.js.map

@@ -26,2 +26,3 @@ "use strict";

{ locale: "id", label: "Bahasa Indonesia" },
{ locale: "ms", label: "Bahasa Melayu" },
{ locale: "ca", label: "Catal\xE0" },

@@ -33,2 +34,3 @@ { locale: "cs", label: "\u010Ce\u0161tina" },

{ locale: "es", label: "Espa\xF1ol" },
{ locale: "tl", label: "Filipino" },
{ locale: "fr", label: "Fran\xE7ais" },

@@ -39,2 +41,3 @@ { locale: "gl", label: "Galego" },

{ locale: "hu", label: "Magyar" },
{ locale: "nl", label: "Nederlands" },
{ locale: "no", label: "Norwegian" },

@@ -45,3 +48,2 @@ { locale: "pl", label: "Polski" },

{ locale: "ro", label: "Rom\xE2n\u0103" },
{ locale: "ru", label: "Russian" },
{ locale: "sl", label: "Sloven\u0161\u010Dina" },

@@ -53,12 +55,21 @@ { locale: "so", label: "Somali" },

{ locale: "tr", label: "T\xFCrk\xE7e" },
{ locale: "uk", label: "Ukrainian" },
{ locale: "el", label: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC" },
{ locale: "ru", label: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439" },
{ locale: "uk", label: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430" },
{ locale: "he", label: "\u05E2\u05D1\u05E8\u05D9\u05EA" },
{ locale: "ur", label: "\u0627\u0631\u062F\u0648" },
{ locale: "ar", label: "\u0639\u0631\u0628\u064A" },
{ locale: "fa", label: "\u0641\u0627\u0631\u0633\u06CC" },
{ locale: "ku", label: "\u06A9\u0648\u0631\u062F\u06CC" },
{ locale: "ne", label: "\u0928\u0947\u092A\u093E\u0932\u0940" },
{ locale: "mr", label: "\u092E\u0930\u093E\u0920\u0940" },
{ locale: "hi-in", label: "\u0939\u093F\u0928\u094D\u0926\u0940" },
{ locale: "bn", label: "\u09AC\u09BE\u0982\u09B2\u09BE" },
{ locale: "pa", label: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40" },
{ locale: "gu-in", label: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0" },
{ locale: "ta", label: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD" },
{ locale: "te", label: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41" },
{ locale: "kn", label: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1" },
{ locale: "ml", label: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02" },
{ locale: "th", label: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22" },
{ locale: "my", label: "\u1019\u103C\u1014\u103A\u1019\u102C\u1005\u102C" },
{ locale: "km-kh", label: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A" },
{ locale: "ko-kr", label: "\uD55C\uAD6D\uC5B4" },

@@ -65,0 +76,0 @@ { locale: "ja", label: "\u65E5\u672C\u8A9E" },

{
"name": "@tldraw/tlschema",
"description": "A tiny little drawing app (schema).",
"version": "3.8.0-canary.58beacd20b55",
"version": "3.8.0-canary.591de9f26464",
"author": {

@@ -56,9 +56,10 @@ "name": "tldraw Inc.",

"dependencies": {
"@tldraw/state": "3.8.0-canary.58beacd20b55",
"@tldraw/store": "3.8.0-canary.58beacd20b55",
"@tldraw/utils": "3.8.0-canary.58beacd20b55",
"@tldraw/validate": "3.8.0-canary.58beacd20b55"
"@tldraw/state": "3.8.0-canary.591de9f26464",
"@tldraw/store": "3.8.0-canary.591de9f26464",
"@tldraw/utils": "3.8.0-canary.591de9f26464",
"@tldraw/validate": "3.8.0-canary.591de9f26464"
},
"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'

@@ -52,6 +52,26 @@ import { CameraRecordType, TLCameraId } from './records/TLCamera'

export interface TLAssetContext {
/**
* The scale at which the asset is being rendered on-screen relative to its native dimensions.
* If the asset is 1000px wide, but it's been resized/zoom so it takes 500px on-screen, this
* will be 0.5.
*
* The scale measures CSS pixels, not device pixels.
*/
screenScale: number
/** The {@link TLAssetContext.screenScale}, stepped to the nearest power-of-2 multiple. */
steppedScreenScale: number
/** The device pixel ratio - how many CSS pixels are in one device pixel? */
dpr: number
/**
* An alias for
* {@link https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType | `navigator.connection.effectiveType` }
* if it's available in the current browser. Use this to e.g. serve lower-resolution images to
* users on slow connections.
*/
networkEffectiveType: string | null
/**
* In some circumstances, we need to resolve a URL that points to the original version of a
* particular asset. This is used when the asset will leave the current tldraw instance - e.g.
* for copy/paste, or exports.
*/
shouldResolveToOriginal: boolean

@@ -82,3 +102,7 @@ }

*/
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<string>
upload(
asset: TLAsset,
file: File,
abortSignal?: AbortSignal
): Promise<{ src: string; meta?: JsonObject }>
/**

@@ -85,0 +109,0 @@ * Resolve an asset to a URL. This is used when rendering the asset in the editor. By default,

@@ -7,2 +7,3 @@ // This file is automatically generated by internal/scripts/refresh-assets.ts.

{ locale: 'id', label: 'Bahasa Indonesia' },
{ locale: 'ms', label: 'Bahasa Melayu' },
{ locale: 'ca', label: 'Català' },

@@ -14,2 +15,3 @@ { locale: 'cs', label: 'Čeština' },

{ locale: 'es', label: 'Español' },
{ locale: 'tl', label: 'Filipino' },
{ locale: 'fr', label: 'Français' },

@@ -20,2 +22,3 @@ { locale: 'gl', label: 'Galego' },

{ locale: 'hu', label: 'Magyar' },
{ locale: 'nl', label: 'Nederlands' },
{ locale: 'no', label: 'Norwegian' },

@@ -26,3 +29,2 @@ { locale: 'pl', label: 'Polski' },

{ locale: 'ro', label: 'Română' },
{ locale: 'ru', label: 'Russian' },
{ locale: 'sl', label: 'Slovenščina' },

@@ -34,12 +36,21 @@ { locale: 'so', label: 'Somali' },

{ locale: 'tr', label: 'Türkçe' },
{ locale: 'uk', label: 'Ukrainian' },
{ locale: 'el', label: 'Ελληνικά' },
{ locale: 'ru', label: 'Русский' },
{ locale: 'uk', label: 'Українська' },
{ locale: 'he', label: 'עברית' },
{ locale: 'ur', label: 'اردو' },
{ locale: 'ar', label: 'عربي' },
{ locale: 'fa', label: 'فارسی' },
{ locale: 'ku', label: 'کوردی' },
{ locale: 'ne', label: 'नेपाली' },
{ locale: 'mr', label: 'मराठी' },
{ locale: 'hi-in', label: 'हिन्दी' },
{ locale: 'bn', label: 'বাংলা' },
{ locale: 'pa', label: 'ਪੰਜਾਬੀ' },
{ locale: 'gu-in', label: 'ગુજરાતી' },
{ locale: 'ta', label: 'தமிழ்' },
{ locale: 'te', label: 'తెలుగు' },
{ locale: 'kn', label: 'ಕನ್ನಡ' },
{ locale: 'ml', label: 'മലയാളം' },
{ locale: 'th', label: 'ภาษาไทย' },
{ locale: 'my', label: 'မြန်မာစာ' },
{ locale: 'km-kh', label: 'ភាសាខ្មែរ' },
{ locale: 'ko-kr', label: '한국어' },

@@ -46,0 +57,0 @@ { locale: 'ja', label: '日本語' },

@@ -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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc