blockly 9.0.0-beta.3 → 9.0.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.
- package/README.md +3 -3
- package/blockly.min.js +350 -357
- package/blockly_compressed.js +350 -357
- package/blockly_compressed.js.map +1 -1
- package/core/block_drag_surface.d.ts +5 -1
- package/core/blockly.d.ts +9 -19
- package/core/css.d.ts +1 -1
- package/core/field.d.ts +39 -12
- package/core/renderers/common/block_rendering.d.ts +2 -18
- package/core/tooltip.d.ts +1 -1
- package/core/utils/object.d.ts +3 -0
- package/core/utils/string.d.ts +1 -1
- package/core/utils/style.d.ts +1 -0
- package/core/utils/svg_math.d.ts +1 -10
- package/core/utils.d.ts +13 -71
- package/core/workspace_svg.d.ts +0 -6
- package/msg/ar.js +25 -25
- package/msg/az.js +17 -17
- package/msg/bcc.js +4 -4
- package/msg/be-tarask.js +16 -16
- package/msg/be.js +6 -6
- package/msg/bg.js +10 -10
- package/msg/bn.js +1 -1
- package/msg/br.js +18 -18
- package/msg/ca.js +1 -1
- package/msg/cs.js +12 -12
- package/msg/da.js +15 -15
- package/msg/de.js +40 -40
- package/msg/diq.js +17 -17
- package/msg/dty.js +2 -2
- package/msg/ee.js +1 -1
- package/msg/el.js +43 -43
- package/msg/en-gb.js +13 -13
- package/msg/eo.js +3 -3
- package/msg/es.js +9 -9
- package/msg/et.js +12 -12
- package/msg/eu.js +2 -2
- package/msg/fa.js +2 -2
- package/msg/fi.js +11 -11
- package/msg/fr.js +28 -28
- package/msg/gor.js +7 -7
- package/msg/ha.js +18 -18
- package/msg/he.js +7 -7
- package/msg/hi.js +18 -18
- package/msg/hr.js +13 -13
- package/msg/hrx.js +2 -2
- package/msg/hu.js +3 -3
- package/msg/hy.js +1 -1
- package/msg/ia.js +8 -8
- package/msg/id.js +29 -29
- package/msg/ig.js +26 -26
- package/msg/is.js +64 -64
- package/msg/it.js +4 -4
- package/msg/ja.js +53 -53
- package/msg/ka.js +2 -2
- package/msg/kab.js +16 -16
- package/msg/kbd-cyrl.js +3 -3
- package/msg/km.js +1 -1
- package/msg/kn.js +18 -18
- package/msg/ko.js +47 -47
- package/msg/ksh.js +1 -1
- package/msg/ky.js +2 -2
- package/msg/lb.js +3 -3
- package/msg/lki.js +14 -14
- package/msg/lo.js +1 -1
- package/msg/lrc.js +15 -15
- package/msg/lt.js +16 -16
- package/msg/lv.js +15 -15
- package/msg/mk.js +1 -1
- package/msg/mnw.js +5 -5
- package/msg/ms.js +14 -14
- package/msg/nb.js +37 -37
- package/msg/ne.js +1 -1
- package/msg/nl.js +39 -39
- package/msg/oc.js +8 -8
- package/msg/pa.js +2 -2
- package/msg/pl.js +30 -30
- package/msg/pms.js +32 -32
- package/msg/pt-br.js +21 -21
- package/msg/pt.js +16 -16
- package/msg/ro.js +25 -25
- package/msg/ru.js +25 -25
- package/msg/sc.js +16 -16
- package/msg/sd.js +4 -4
- package/msg/sk.js +16 -16
- package/msg/skr-arab.js +4 -4
- package/msg/sl.js +49 -49
- package/msg/sq.js +14 -14
- package/msg/sr-latn.js +22 -22
- package/msg/sr.js +26 -26
- package/msg/sv.js +29 -29
- package/msg/ta.js +10 -10
- package/msg/tcy.js +5 -5
- package/msg/tdd.js +440 -0
- package/msg/th.js +8 -8
- package/msg/tr.js +16 -16
- package/msg/uk.js +17 -17
- package/msg/ur.js +5 -5
- package/msg/uz.js +1 -1
- package/msg/vi.js +17 -17
- package/msg/yo.js +15 -15
- package/msg/zgh.js +11 -11
- package/msg/zh-hans.js +16 -16
- package/msg/zh-hant.js +12 -12
- package/package.json +1 -1
|
@@ -33,7 +33,11 @@ export declare class BlockDragSurfaceSvg {
|
|
|
33
33
|
private readonly childSurfaceXY_;
|
|
34
34
|
/** @param container Containing element. */
|
|
35
35
|
constructor(container: Element);
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Create the drag surface and inject it into the container.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated The DOM is automatically created by the constructor.
|
|
40
|
+
*/
|
|
37
41
|
createDom(): void;
|
|
38
42
|
/**
|
|
39
43
|
* Set the SVG blocks on the drag surface's group and show the surface.
|
package/core/blockly.d.ts
CHANGED
|
@@ -282,22 +282,12 @@ export declare const defineBlocksWithJsonArray: typeof common.defineBlocksWithJs
|
|
|
282
282
|
* @alias Blockly.setParentContainer
|
|
283
283
|
*/
|
|
284
284
|
export declare const setParentContainer: typeof common.setParentContainer;
|
|
285
|
-
/**
|
|
286
|
-
* Returns the dimensions of the specified SVG image.
|
|
287
|
-
*
|
|
288
|
-
* @param svg SVG image.
|
|
289
|
-
* @returns Contains width and height properties.
|
|
290
|
-
* @deprecated Use workspace.setCachedParentSvgSize. (2021 March 5)
|
|
291
|
-
* @see Blockly.WorkspaceSvg.setCachedParentSvgSize
|
|
292
|
-
* @alias Blockly.svgSize
|
|
293
|
-
*/
|
|
294
|
-
export declare const svgSize: typeof utils.svgMath.svgSize;
|
|
295
285
|
/**
|
|
296
286
|
* Size the workspace when the contents change. This also updates
|
|
297
287
|
* scrollbars accordingly.
|
|
298
288
|
*
|
|
299
289
|
* @param workspace The workspace to resize.
|
|
300
|
-
* @deprecated Use workspace.resizeContents.
|
|
290
|
+
* @deprecated Use **workspace.resizeContents** instead.
|
|
301
291
|
* @see Blockly.WorkspaceSvg.resizeContents
|
|
302
292
|
* @alias Blockly.resizeSvgContents
|
|
303
293
|
*/
|
|
@@ -307,7 +297,7 @@ export declare const resizeSvgContents: typeof resizeSvgContentsLocal;
|
|
|
307
297
|
* Copy a block or workspace comment onto the local clipboard.
|
|
308
298
|
*
|
|
309
299
|
* @param toCopy Block or Workspace Comment to be copied.
|
|
310
|
-
* @deprecated Use Blockly.clipboard.copy
|
|
300
|
+
* @deprecated Use **Blockly.clipboard.copy** instead.
|
|
311
301
|
* @see Blockly.clipboard.copy
|
|
312
302
|
* @alias Blockly.copy
|
|
313
303
|
*/
|
|
@@ -316,7 +306,7 @@ export declare function copy(toCopy: ICopyable): void;
|
|
|
316
306
|
* Paste a block or workspace comment on to the main workspace.
|
|
317
307
|
*
|
|
318
308
|
* @returns True if the paste was successful, false otherwise.
|
|
319
|
-
* @deprecated Use Blockly.clipboard.paste
|
|
309
|
+
* @deprecated Use **Blockly.clipboard.paste** instead.
|
|
320
310
|
* @see Blockly.clipboard.paste
|
|
321
311
|
* @alias Blockly.paste
|
|
322
312
|
*/
|
|
@@ -325,7 +315,7 @@ export declare function paste(): boolean;
|
|
|
325
315
|
* Duplicate this block and its children, or a workspace comment.
|
|
326
316
|
*
|
|
327
317
|
* @param toDuplicate Block or Workspace Comment to be copied.
|
|
328
|
-
* @deprecated Use Blockly.clipboard.duplicate
|
|
318
|
+
* @deprecated Use **Blockly.clipboard.duplicate** instead.
|
|
329
319
|
* @see Blockly.clipboard.duplicate
|
|
330
320
|
* @alias Blockly.duplicate
|
|
331
321
|
*/
|
|
@@ -335,7 +325,7 @@ export declare function duplicate(toDuplicate: ICopyable): void;
|
|
|
335
325
|
*
|
|
336
326
|
* @param str Input string.
|
|
337
327
|
* @returns True if number, false otherwise.
|
|
338
|
-
* @deprecated Use Blockly.utils.string.isNumber
|
|
328
|
+
* @deprecated Use **Blockly.utils.string.isNumber** instead.
|
|
339
329
|
* @see Blockly.utils.string.isNumber
|
|
340
330
|
* @alias Blockly.isNumber
|
|
341
331
|
*/
|
|
@@ -345,7 +335,7 @@ export declare function isNumber(str: string): boolean;
|
|
|
345
335
|
*
|
|
346
336
|
* @param hue Hue on a colour wheel (0-360).
|
|
347
337
|
* @returns RGB code, e.g. '#5ba65b'.
|
|
348
|
-
* @deprecated Use Blockly.utils.colour.hueToHex
|
|
338
|
+
* @deprecated Use **Blockly.utils.colour.hueToHex** instead.
|
|
349
339
|
* @see Blockly.utils.colour.hueToHex
|
|
350
340
|
* @alias Blockly.hueToHex
|
|
351
341
|
*/
|
|
@@ -361,7 +351,7 @@ export declare function hueToHex(hue: number): string;
|
|
|
361
351
|
* @param thisObject The value of 'this' in the function.
|
|
362
352
|
* @param func Function to call when event is triggered.
|
|
363
353
|
* @returns Opaque data that can be passed to unbindEvent_.
|
|
364
|
-
* @deprecated Use Blockly.browserEvents.bind
|
|
354
|
+
* @deprecated Use **Blockly.browserEvents.bind** instead.
|
|
365
355
|
* @see Blockly.browserEvents.bind
|
|
366
356
|
* @alias Blockly.bindEvent_
|
|
367
357
|
*/
|
|
@@ -372,7 +362,7 @@ export declare function bindEvent_(node: EventTarget, name: string, thisObject:
|
|
|
372
362
|
* @param bindData Opaque data from bindEvent_.
|
|
373
363
|
* This list is emptied during the course of calling this function.
|
|
374
364
|
* @returns The function call.
|
|
375
|
-
* @deprecated Use Blockly.browserEvents.unbind
|
|
365
|
+
* @deprecated Use **Blockly.browserEvents.unbind** instead.
|
|
376
366
|
* @see browserEvents.unbind
|
|
377
367
|
* @alias Blockly.unbindEvent_
|
|
378
368
|
*/
|
|
@@ -394,7 +384,7 @@ export declare function unbindEvent_(bindData: browserEvents.Data): Function;
|
|
|
394
384
|
* the default handler. False by default. If opt_noPreventDefault is
|
|
395
385
|
* provided, opt_noCaptureIdentifier must also be provided.
|
|
396
386
|
* @returns Opaque data that can be passed to unbindEvent_.
|
|
397
|
-
* @deprecated Use Blockly.browserEvents.conditionalBind
|
|
387
|
+
* @deprecated Use **Blockly.browserEvents.conditionalBind** instead.
|
|
398
388
|
* @see browserEvents.conditionalBind
|
|
399
389
|
* @alias Blockly.bindEventWithChecks_
|
|
400
390
|
*/
|
package/core/css.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @param cssContent Multiline CSS string or an array of single lines of CSS.
|
|
11
11
|
* @alias Blockly.Css.register
|
|
12
12
|
*/
|
|
13
|
-
export declare function register(cssContent: string
|
|
13
|
+
export declare function register(cssContent: string): void;
|
|
14
14
|
/**
|
|
15
15
|
* Inject the CSS into the DOM. This is preferable over using a regular CSS
|
|
16
16
|
* file since:
|
package/core/field.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
38
38
|
name?: string;
|
|
39
39
|
protected value_: any;
|
|
40
40
|
/** Validation function called when user edits an editable field. */
|
|
41
|
-
protected validator_: Function;
|
|
41
|
+
protected validator_: Function | null;
|
|
42
42
|
/**
|
|
43
43
|
* Used to cache the field's tooltip value if setTooltip is called when the
|
|
44
44
|
* field is not yet initialized. Is *not* guaranteed to be accurate.
|
|
@@ -56,17 +56,17 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
56
56
|
*/
|
|
57
57
|
private markerSvg_;
|
|
58
58
|
/** The rendered field's SVG group element. */
|
|
59
|
-
protected fieldGroup_: SVGGElement;
|
|
59
|
+
protected fieldGroup_: SVGGElement | null;
|
|
60
60
|
/** The rendered field's SVG border element. */
|
|
61
|
-
protected borderRect_: SVGRectElement;
|
|
61
|
+
protected borderRect_: SVGRectElement | null;
|
|
62
62
|
/** The rendered field's SVG text element. */
|
|
63
|
-
protected textElement_: SVGTextElement;
|
|
63
|
+
protected textElement_: SVGTextElement | null;
|
|
64
64
|
/** The rendered field's text content element. */
|
|
65
|
-
protected textContent_: Text;
|
|
65
|
+
protected textContent_: Text | null;
|
|
66
66
|
/** Mouse down event listener data. */
|
|
67
67
|
private mouseDownWrapper_;
|
|
68
68
|
/** Constants associated with the source block's renderer. */
|
|
69
|
-
protected constants_: ConstantProvider;
|
|
69
|
+
protected constants_: ConstantProvider | null;
|
|
70
70
|
/**
|
|
71
71
|
* Has this field been disposed of?
|
|
72
72
|
*
|
|
@@ -76,7 +76,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
76
76
|
/** Maximum characters of text to display before adding an ellipsis. */
|
|
77
77
|
maxDisplayLength: number;
|
|
78
78
|
/** Block this field is attached to. Starts as null, then set in init. */
|
|
79
|
-
protected sourceBlock_: Block;
|
|
79
|
+
protected sourceBlock_: Block | null;
|
|
80
80
|
/** Does this block need to be re-rendered? */
|
|
81
81
|
protected isDirty_: boolean;
|
|
82
82
|
/** Is the field visible, or hidden due to the block being collapsed? */
|
|
@@ -86,7 +86,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
86
86
|
*/
|
|
87
87
|
protected enabled_: boolean;
|
|
88
88
|
/** The element the click handler is bound to. */
|
|
89
|
-
protected clickTarget_: Element;
|
|
89
|
+
protected clickTarget_: Element | null;
|
|
90
90
|
/**
|
|
91
91
|
* The prefix field.
|
|
92
92
|
*
|
|
@@ -149,6 +149,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
149
149
|
* Get the block this field is attached to.
|
|
150
150
|
*
|
|
151
151
|
* @returns The block containing this field.
|
|
152
|
+
* @throws An error if the source block is not defined.
|
|
152
153
|
*/
|
|
153
154
|
getSourceBlock(): Block;
|
|
154
155
|
/**
|
|
@@ -234,7 +235,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
234
235
|
* Used to see if `this` has overridden any relevant hooks.
|
|
235
236
|
* @returns The stringified version of the XML state, or null.
|
|
236
237
|
*/
|
|
237
|
-
protected saveLegacyState(callingClass:
|
|
238
|
+
protected saveLegacyState(callingClass: FieldProto): string | null;
|
|
238
239
|
/**
|
|
239
240
|
* Loads the given state using either the old XML hooks, if they should be
|
|
240
241
|
* used. Returns true to indicate loading has been handled, false otherwise.
|
|
@@ -244,7 +245,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
244
245
|
* @param state The state to apply to the field.
|
|
245
246
|
* @returns Whether the state was applied or not.
|
|
246
247
|
*/
|
|
247
|
-
loadLegacyState(callingClass:
|
|
248
|
+
loadLegacyState(callingClass: FieldProto, state: any): boolean;
|
|
248
249
|
/**
|
|
249
250
|
* Dispose of all DOM objects and events belonging to this editable field.
|
|
250
251
|
*
|
|
@@ -331,7 +332,28 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
331
332
|
*
|
|
332
333
|
* @returns The group element.
|
|
333
334
|
*/
|
|
334
|
-
getSvgRoot(): SVGGElement;
|
|
335
|
+
getSvgRoot(): SVGGElement | null;
|
|
336
|
+
/**
|
|
337
|
+
* Gets the border rectangle element.
|
|
338
|
+
*
|
|
339
|
+
* @returns The border rectangle element.
|
|
340
|
+
* @throws An error if the border rectangle element is not defined.
|
|
341
|
+
*/
|
|
342
|
+
protected getBorderRect(): SVGRectElement;
|
|
343
|
+
/**
|
|
344
|
+
* Gets the text element.
|
|
345
|
+
*
|
|
346
|
+
* @returns The text element.
|
|
347
|
+
* @throws An error if the text element is not defined.
|
|
348
|
+
*/
|
|
349
|
+
protected getTextElement(): SVGTextElement;
|
|
350
|
+
/**
|
|
351
|
+
* Gets the text content.
|
|
352
|
+
*
|
|
353
|
+
* @returns The text content.
|
|
354
|
+
* @throws An error if the text content is not defined.
|
|
355
|
+
*/
|
|
356
|
+
protected getTextContent(): Text;
|
|
335
357
|
/**
|
|
336
358
|
* Updates the field to match the colour/style of the block. Should only be
|
|
337
359
|
* called by BlockSvg.applyColour().
|
|
@@ -514,7 +536,7 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
514
536
|
*
|
|
515
537
|
* @returns Element to bind click handler to.
|
|
516
538
|
*/
|
|
517
|
-
protected getClickTarget_(): Element;
|
|
539
|
+
protected getClickTarget_(): Element | null;
|
|
518
540
|
/**
|
|
519
541
|
* Return the absolute coordinates of the top-left corner of this field.
|
|
520
542
|
* The origin (0,0) is the top-left corner of the page body.
|
|
@@ -588,4 +610,9 @@ export declare abstract class Field implements IASTNodeLocationSvg, IASTNodeLoca
|
|
|
588
610
|
export interface FieldConfig {
|
|
589
611
|
tooltip?: string;
|
|
590
612
|
}
|
|
613
|
+
/**
|
|
614
|
+
* For use by Field and descendants of Field. Constructors can change
|
|
615
|
+
* in descendants, though they should contain all of Field's prototype methods.
|
|
616
|
+
*/
|
|
617
|
+
export declare type FieldProto = Pick<typeof Field, 'prototype'>;
|
|
591
618
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -34,15 +34,6 @@ import { RenderInfo } from './info.js';
|
|
|
34
34
|
import { MarkerSvg } from './marker_svg.js';
|
|
35
35
|
import { PathObject } from './path_object.js';
|
|
36
36
|
import { Renderer } from './renderer.js';
|
|
37
|
-
/**
|
|
38
|
-
* Returns whether the debugger is turned on.
|
|
39
|
-
*
|
|
40
|
-
* @returns Whether the debugger is turned on.
|
|
41
|
-
* @alias Blockly.blockRendering.isDebuggerEnabled
|
|
42
|
-
* @deprecated
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare function isDebuggerEnabled(): boolean;
|
|
46
37
|
/**
|
|
47
38
|
* Registers a new renderer.
|
|
48
39
|
*
|
|
@@ -58,19 +49,12 @@ export declare function register(name: string, rendererClass: Function): void;
|
|
|
58
49
|
* @alias Blockly.blockRendering.unregister
|
|
59
50
|
*/
|
|
60
51
|
export declare function unregister(name: string): void;
|
|
61
|
-
/**
|
|
62
|
-
* Turn on the blocks debugger.
|
|
63
|
-
*
|
|
64
|
-
* @alias Blockly.blockRendering.startDebugger
|
|
65
|
-
* @deprecated
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
export declare function startDebugger(): void;
|
|
69
52
|
/**
|
|
70
53
|
* Turn off the blocks debugger.
|
|
71
54
|
*
|
|
72
55
|
* @alias Blockly.blockRendering.stopDebugger
|
|
73
|
-
* @deprecated
|
|
56
|
+
* @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
|
|
57
|
+
* https://www.npmjs.com/package/@blockly/dev-tools}.)
|
|
74
58
|
* @internal
|
|
75
59
|
*/
|
|
76
60
|
export declare function stopDebugger(): void;
|
package/core/tooltip.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ export declare function bindMouseEvents(element: Element): void;
|
|
|
114
114
|
* @param element SVG element onto which tooltip is bound.
|
|
115
115
|
* @alias Blockly.Tooltip.unbindMouseEvents
|
|
116
116
|
*/
|
|
117
|
-
export declare function unbindMouseEvents(element: Element): void;
|
|
117
|
+
export declare function unbindMouseEvents(element: Element | null): void;
|
|
118
118
|
/**
|
|
119
119
|
* Dispose of the tooltip.
|
|
120
120
|
*
|
package/core/utils/object.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @param childCtor Child class.
|
|
10
10
|
* @param parentCtor Parent class.
|
|
11
11
|
* @suppress {strictMissingProperties} superClass_ is not defined on Function.
|
|
12
|
+
* @deprecated No longer provided by Blockly.
|
|
12
13
|
* @alias Blockly.utils.object.inherits
|
|
13
14
|
*/
|
|
14
15
|
export declare function inherits(childCtor: Function, parentCtor: Function): void;
|
|
@@ -17,6 +18,7 @@ export declare function inherits(childCtor: Function, parentCtor: Function): voi
|
|
|
17
18
|
*
|
|
18
19
|
* @param target Target.
|
|
19
20
|
* @param source Source.
|
|
21
|
+
* @deprecated Use the built-in **Object.assign** instead.
|
|
20
22
|
* @alias Blockly.utils.object.mixin
|
|
21
23
|
*/
|
|
22
24
|
export declare function mixin(target: any, source: any): void;
|
|
@@ -34,6 +36,7 @@ export declare function deepMerge(target: any, source: any): any;
|
|
|
34
36
|
*
|
|
35
37
|
* @param obj Object containing values.
|
|
36
38
|
* @returns Array of values.
|
|
39
|
+
* @deprecated Use the built-in **Object.values** instead.
|
|
37
40
|
* @alias Blockly.utils.object.values
|
|
38
41
|
*/
|
|
39
42
|
export declare function values(obj: any): any[];
|
package/core/utils/string.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param prefix A string to look for at the start of `str`.
|
|
12
12
|
* @returns True if `str` begins with `prefix`.
|
|
13
13
|
* @alias Blockly.utils.string.startsWith
|
|
14
|
-
* @deprecated
|
|
14
|
+
* @deprecated Use built-in **string.startsWith** instead.
|
|
15
15
|
*/
|
|
16
16
|
export declare function startsWith(str: string, prefix: string): boolean;
|
|
17
17
|
/**
|
package/core/utils/style.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare function getComputedStyle(element: Element, property: string): st
|
|
|
41
41
|
* @param element Element to get style of.
|
|
42
42
|
* @param style Property to get (camel-case).
|
|
43
43
|
* @returns Style value.
|
|
44
|
+
* @deprecated No longer provided by Blockly.
|
|
44
45
|
* @alias Blockly.utils.style.getCascadedStyle
|
|
45
46
|
*/
|
|
46
47
|
export declare function getCascadedStyle(element: Element, style: string): string;
|
package/core/utils/svg_math.d.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
7
7
|
import { Coordinate } from './coordinate.js';
|
|
8
8
|
import { Rect } from './rect.js';
|
|
9
|
-
import { Size } from './size.js';
|
|
10
9
|
/**
|
|
11
10
|
* Return the coordinates of the top-left corner of this element relative to
|
|
12
11
|
* its parent. Only for SVG elements and children (e.g. rect, g, path).
|
|
@@ -31,6 +30,7 @@ export declare function getInjectionDivXY(element: Element): Coordinate;
|
|
|
31
30
|
* and attempting to set the property.
|
|
32
31
|
*
|
|
33
32
|
* @returns True if 3D transforms are supported.
|
|
33
|
+
* @deprecated No longer provided by Blockly.
|
|
34
34
|
* @alias Blockly.utils.svgMath.is3dSupported
|
|
35
35
|
*/
|
|
36
36
|
export declare function is3dSupported(): boolean;
|
|
@@ -62,15 +62,6 @@ export declare function getDocumentScroll(): Coordinate;
|
|
|
62
62
|
* @alias Blockly.utils.svgMath.screenToWsCoordinates
|
|
63
63
|
*/
|
|
64
64
|
export declare function screenToWsCoordinates(ws: WorkspaceSvg, screenCoordinates: Coordinate): Coordinate;
|
|
65
|
-
/**
|
|
66
|
-
* Returns the dimensions of the specified SVG image.
|
|
67
|
-
*
|
|
68
|
-
* @param svg SVG image.
|
|
69
|
-
* @returns Contains width and height properties.
|
|
70
|
-
* @deprecated Use workspace.getCachedParentSvgSize. (2021 March 5)
|
|
71
|
-
* @alias Blockly.utils.svgMath.svgSize
|
|
72
|
-
*/
|
|
73
|
-
export declare function svgSize(svg: SVGElement): Size;
|
|
74
65
|
export declare const TEST_ONLY: {
|
|
75
66
|
XY_REGEX: RegExp;
|
|
76
67
|
XY_STYLE_REGEX: RegExp;
|
package/core/utils.d.ts
CHANGED
|
@@ -30,30 +30,13 @@ import * as userAgent from './utils/useragent.js';
|
|
|
30
30
|
import * as xml from './utils/xml.js';
|
|
31
31
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
32
32
|
export { aria, arrayUtils as array, browserEvents, colour, Coordinate, deprecation, dom, extensions, idGenerator, KeyCodes, math, Metrics, object, parsing, Rect, Size, stringUtils as string, style, Svg, svgMath, svgPaths, toolbox, userAgent, xml, };
|
|
33
|
-
/**
|
|
34
|
-
* Halts the propagation of the event without doing anything else.
|
|
35
|
-
*
|
|
36
|
-
* @param e An event.
|
|
37
|
-
* @deprecated
|
|
38
|
-
* @alias Blockly.utils.noEvent
|
|
39
|
-
*/
|
|
40
|
-
export declare function noEvent(e: Event): void;
|
|
41
|
-
/**
|
|
42
|
-
* Returns true if this event is targeting a text input widget?
|
|
43
|
-
*
|
|
44
|
-
* @param e An event.
|
|
45
|
-
* @returns True if text input.
|
|
46
|
-
* @deprecated Use Blockly.browserEvents.isTargetInput instead.
|
|
47
|
-
* @alias Blockly.utils.isTargetInput
|
|
48
|
-
*/
|
|
49
|
-
export declare function isTargetInput(e: Event): boolean;
|
|
50
33
|
/**
|
|
51
34
|
* Return the coordinates of the top-left corner of this element relative to
|
|
52
35
|
* its parent. Only for SVG elements and children (e.g. rect, g, path).
|
|
53
36
|
*
|
|
54
37
|
* @param element SVG element to find the coordinates of.
|
|
55
38
|
* @returns Object with .x and .y properties.
|
|
56
|
-
* @deprecated
|
|
39
|
+
* @deprecated Use **Blockly.utils.svgMath.getRelativeXY** instead.
|
|
57
40
|
* @alias Blockly.utils.getRelativeXY
|
|
58
41
|
*/
|
|
59
42
|
export declare function getRelativeXY(element: Element): Coordinate;
|
|
@@ -64,44 +47,11 @@ export declare function getRelativeXY(element: Element): Coordinate;
|
|
|
64
47
|
* @param element SVG element to find the coordinates of. If this is not a child
|
|
65
48
|
* of the div Blockly was injected into, the behaviour is undefined.
|
|
66
49
|
* @returns Object with .x and .y properties.
|
|
67
|
-
* @deprecated
|
|
50
|
+
* @deprecated Use **Blockly.utils.svgMath.getInjectionDivXY** instead.
|
|
68
51
|
* @alias Blockly.utils.getInjectionDivXY_
|
|
69
52
|
*/
|
|
70
53
|
declare function getInjectionDivXY(element: Element): Coordinate;
|
|
71
54
|
export declare const getInjectionDivXY_: typeof getInjectionDivXY;
|
|
72
|
-
/**
|
|
73
|
-
* Returns true this event is a right-click.
|
|
74
|
-
*
|
|
75
|
-
* @param e Mouse event.
|
|
76
|
-
* @returns True if right-click.
|
|
77
|
-
* @deprecated Use Blockly.browserEvents.isRightButton instead.
|
|
78
|
-
* @alias Blockly.utils.isRightButton
|
|
79
|
-
*/
|
|
80
|
-
export declare function isRightButton(e: Event): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Returns the converted coordinates of the given mouse event.
|
|
83
|
-
* The origin (0,0) is the top-left corner of the Blockly SVG.
|
|
84
|
-
*
|
|
85
|
-
* @param e Mouse event.
|
|
86
|
-
* @param svg SVG element.
|
|
87
|
-
* @param matrix Inverted screen CTM to use.
|
|
88
|
-
* @returns Object with .x and .y properties.
|
|
89
|
-
* @deprecated Use Blockly.browserEvents.mouseToSvg instead;
|
|
90
|
-
* @alias Blockly.utils.mouseToSvg
|
|
91
|
-
*/
|
|
92
|
-
export declare function mouseToSvg(e: Event, svg: SVGSVGElement, matrix: SVGMatrix | null): SVGPoint;
|
|
93
|
-
/**
|
|
94
|
-
* Returns the scroll delta of a mouse event in pixel units.
|
|
95
|
-
*
|
|
96
|
-
* @param e Mouse event.
|
|
97
|
-
* @returns Scroll delta object with .x and .y properties.
|
|
98
|
-
* @deprecated Use Blockly.browserEvents.getScrollDeltaPixels instead.
|
|
99
|
-
* @alias Blockly.utils.getScrollDeltaPixels
|
|
100
|
-
*/
|
|
101
|
-
export declare function getScrollDeltaPixels(e: WheelEvent): {
|
|
102
|
-
x: number;
|
|
103
|
-
y: number;
|
|
104
|
-
};
|
|
105
55
|
/**
|
|
106
56
|
* Parse a string with any number of interpolation tokens (%1, %2, ...).
|
|
107
57
|
* It will also replace string table references (e.g., %{bky_my_msg} and
|
|
@@ -112,7 +62,7 @@ export declare function getScrollDeltaPixels(e: WheelEvent): {
|
|
|
112
62
|
* @param message Text which might contain string table references and
|
|
113
63
|
* interpolation tokens.
|
|
114
64
|
* @returns Array of strings and numbers.
|
|
115
|
-
* @deprecated
|
|
65
|
+
* @deprecated Use **Blockly.utils.parsing.tokenizeInterpolation** instead.
|
|
116
66
|
* @alias Blockly.utils.tokenizeInterpolation
|
|
117
67
|
*/
|
|
118
68
|
export declare function tokenizeInterpolation(message: string): Array<string | number>;
|
|
@@ -124,7 +74,7 @@ export declare function tokenizeInterpolation(message: string): Array<string | n
|
|
|
124
74
|
* @param message Message, which may be a string that contains string table
|
|
125
75
|
* references.
|
|
126
76
|
* @returns String with message references replaced.
|
|
127
|
-
* @deprecated
|
|
77
|
+
* @deprecated Use **Blockly.utils.parsing.replaceMessageReferences** instead.
|
|
128
78
|
* @alias Blockly.utils.replaceMessageReferences
|
|
129
79
|
*/
|
|
130
80
|
export declare function replaceMessageReferences(message: string | any): string;
|
|
@@ -135,24 +85,16 @@ export declare function replaceMessageReferences(message: string | any): string;
|
|
|
135
85
|
* @param message Text which might contain string table references.
|
|
136
86
|
* @returns True if all message references have matching values.
|
|
137
87
|
* Otherwise, false.
|
|
138
|
-
* @deprecated
|
|
88
|
+
* @deprecated Use **Blockly.utils.parsing.checkMessageReferences** instead.
|
|
139
89
|
* @alias Blockly.utils.checkMessageReferences
|
|
140
90
|
*/
|
|
141
91
|
export declare function checkMessageReferences(message: string): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Generate a unique ID.
|
|
144
|
-
*
|
|
145
|
-
* @returns A globally unique ID string.
|
|
146
|
-
* @deprecated Use Blockly.utils.idGenerator.genUid instead.
|
|
147
|
-
* @alias Blockly.utils.genUid
|
|
148
|
-
*/
|
|
149
|
-
export declare function genUid(): string;
|
|
150
92
|
/**
|
|
151
93
|
* Check if 3D transforms are supported by adding an element
|
|
152
94
|
* and attempting to set the property.
|
|
153
95
|
*
|
|
154
96
|
* @returns True if 3D transforms are supported.
|
|
155
|
-
* @deprecated
|
|
97
|
+
* @deprecated Use **Blockly.utils.svgMath.is3dSupported** instead.
|
|
156
98
|
* @alias Blockly.utils.is3dSupported
|
|
157
99
|
*/
|
|
158
100
|
export declare function is3dSupported(): boolean;
|
|
@@ -163,7 +105,7 @@ export declare function is3dSupported(): boolean;
|
|
|
163
105
|
* @returns An object containing window width, height, and scroll position in
|
|
164
106
|
* window coordinates.
|
|
165
107
|
* @alias Blockly.utils.getViewportBBox
|
|
166
|
-
* @deprecated
|
|
108
|
+
* @deprecated Use **Blockly.utils.svgMath.getViewportBBox** instead.
|
|
167
109
|
* @internal
|
|
168
110
|
*/
|
|
169
111
|
export declare function getViewportBBox(): Rect;
|
|
@@ -174,7 +116,7 @@ export declare function getViewportBBox(): Rect;
|
|
|
174
116
|
* @param value Value to remove.
|
|
175
117
|
* @returns True if an element was removed.
|
|
176
118
|
* @alias Blockly.utils.arrayRemove
|
|
177
|
-
* @deprecated
|
|
119
|
+
* @deprecated Use **Blockly.array.removeElem** instead.
|
|
178
120
|
* @internal
|
|
179
121
|
*/
|
|
180
122
|
export declare function arrayRemove<T>(arr: Array<T>, value: T): boolean;
|
|
@@ -183,7 +125,7 @@ export declare function arrayRemove<T>(arr: Array<T>, value: T): boolean;
|
|
|
183
125
|
* Copied from Closure's goog.dom.getDocumentScroll.
|
|
184
126
|
*
|
|
185
127
|
* @returns Object with values 'x' and 'y'.
|
|
186
|
-
* @deprecated
|
|
128
|
+
* @deprecated Use **Blockly.utils.svgMath.getDocumentScroll** instead.
|
|
187
129
|
* @alias Blockly.utils.getDocumentScroll
|
|
188
130
|
*/
|
|
189
131
|
export declare function getDocumentScroll(): Coordinate;
|
|
@@ -195,7 +137,7 @@ export declare function getDocumentScroll(): Coordinate;
|
|
|
195
137
|
* @param opt_stripFollowing Optionally ignore all following statements (blocks
|
|
196
138
|
* that are not inside a value or statement input of the block).
|
|
197
139
|
* @returns Map of types to type counts for descendants of the bock.
|
|
198
|
-
* @deprecated
|
|
140
|
+
* @deprecated Use **Blockly.common.getBlockTypeCounts** instead.
|
|
199
141
|
* @alias Blockly.utils.getBlockTypeCounts
|
|
200
142
|
*/
|
|
201
143
|
export declare function getBlockTypeCounts(block: Block, opt_stripFollowing?: boolean): {
|
|
@@ -207,7 +149,7 @@ export declare function getBlockTypeCounts(block: Block, opt_stripFollowing?: bo
|
|
|
207
149
|
* @param ws The workspace to find the coordinates on.
|
|
208
150
|
* @param screenCoordinates The screen coordinates to be converted to workspace
|
|
209
151
|
* coordinates
|
|
210
|
-
* @deprecated
|
|
152
|
+
* @deprecated Use **Blockly.utils.svgMath.screenToWsCoordinates** instead.
|
|
211
153
|
* @returns The workspace coordinates.
|
|
212
154
|
*/
|
|
213
155
|
export declare function screenToWsCoordinates(ws: WorkspaceSvg, screenCoordinates: Coordinate): Coordinate;
|
|
@@ -220,7 +162,7 @@ export declare function screenToWsCoordinates(ws: WorkspaceSvg, screenCoordinate
|
|
|
220
162
|
* @returns An object containing the colour as a #RRGGBB string, and the hue if
|
|
221
163
|
* the input was an HSV hue value.
|
|
222
164
|
* @throws {Error} If the colour cannot be parsed.
|
|
223
|
-
* @deprecated
|
|
165
|
+
* @deprecated Use **Blockly.utils.parsing.parseBlockColour** instead.
|
|
224
166
|
* @alias Blockly.utils.parseBlockColour
|
|
225
167
|
*/
|
|
226
168
|
export declare function parseBlockColour(colour: number | string): {
|
|
@@ -232,7 +174,7 @@ export declare function parseBlockColour(colour: number | string): {
|
|
|
232
174
|
*
|
|
233
175
|
* @param fn Function to run.
|
|
234
176
|
* @throws Error Will throw if no global document can be found (e.g., Node.js).
|
|
235
|
-
* @deprecated
|
|
177
|
+
* @deprecated No longer provided by Blockly.
|
|
236
178
|
* @alias Blockly.utils.runAfterPageLoad
|
|
237
179
|
*/
|
|
238
180
|
export declare function runAfterPageLoad(fn: () => void): void;
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -658,12 +658,6 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
658
658
|
* @returns The newly created variable.
|
|
659
659
|
*/
|
|
660
660
|
createVariable(name: string, opt_type?: string | null, opt_id?: string | null): VariableModel;
|
|
661
|
-
/**
|
|
662
|
-
* Make a list of all the delete areas for this workspace.
|
|
663
|
-
*
|
|
664
|
-
* @deprecated Use workspace.recordDragTargets. (2021 June)
|
|
665
|
-
*/
|
|
666
|
-
recordDeleteAreas(): void;
|
|
667
661
|
/** Make a list of all the delete areas for this workspace. */
|
|
668
662
|
recordDragTargets(): void;
|
|
669
663
|
/**
|