Skip to content

Commit 721da5e

Browse files
authored
Merge pull request #938
Update with release/2025.3
2 parents 7a30b36 + ecfeac7 commit 721da5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3372
-507
lines changed

.eslintrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
"MSSharedTextStyleProvider": "readonly",
9595
"MSForeignObjectProvider": "readonly",
9696
"MSSharedStyle": "readonly",
97+
"MSImmutableSharedStyle": "readonly",
9798
"MSStyle": "readonly",
99+
"MSImmutableStyle": "readonly",
98100
"MSDataOverride": "readonly",
99101
"MSImmutableLayerGroup": "readonly",
100102
"MSImmutableHotspotLayer": "readonly",
@@ -146,8 +148,9 @@
146148
"MSPath": "readonly",
147149
"SVGPathInterpreter": "readonly",
148150
"NSBezierPath": "readonly",
151+
"MSImmutableModelObject": "readonly",
149152
"MSJSONDataArchiver": "readonly",
150-
"MSJSONDictionaryUnarchiver": "readonly",
153+
"MSJSONUnarchiver": "readonly",
151154
"MSArchiveHeader": "readonly",
152155
"NSUTF8StringEncoding": "readonly",
153156
"MSExportRequest": "readonly",
@@ -183,11 +186,13 @@
183186
"MSInferredGroupLayout": "readonly",
184187
"MSFreeformGroupLayout": "readonly",
185188
"MSSwatch": "readonly",
189+
"MSImmutableSwatch": "readonly",
186190
"MSSwatchReference": "readonly",
187191
"MSSwatchProvider": "readonly",
188192
"NSUUID": "readonly",
189193
"NSError": "readonly",
190194
"NSMapTable": "readonly",
191-
"MSTextAlignmentConverter": "readonly"
195+
"MSTextAlignmentConverter": "readonly",
196+
"MSImmutableLayerAncestry": "readonly"
192197
}
193198
}

.vscode/tasks.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,34 @@
119119
"SKETCH_VARIANT_BUNDLE_ID": "${input:sketchTarget}"
120120
}
121121
}
122+
},
123+
//
124+
// Test (Single Suite, Custom Sketch)
125+
//
126+
{
127+
"label": "Test [Single Suite, Custom Sketch]",
128+
"dependsOrder": "sequence",
129+
"dependsOn": [
130+
"[Show the test suite name prompt]",
131+
"[Show target Sketch variant prompt]",
132+
"Build & Lint",
133+
"Test Single Suite on Sketch Variant"
134+
],
135+
"group": {
136+
"kind": "test"
137+
}
138+
},
139+
{
140+
"label": "Test Single Suite on Sketch Variant",
141+
"type": "npm",
142+
"script": "test:suiteOnCustom",
143+
"hide": true,
144+
"options": {
145+
"env": {
146+
"TEST_SUITE": "${input:testSuite}",
147+
"SKETCH_VARIANT_BUNDLE_ID": "${input:sketchTarget}"
148+
}
149+
}
122150
}
123151
],
124152
//

SketchAPI.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 63;
6+
objectVersion = 77;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -127,7 +127,6 @@
127127
};
128128
};
129129
buildConfigurationList = 437121362469F097000570FA /* Build configuration list for PBXProject "SketchAPI" */;
130-
compatibilityVersion = "Xcode 15.0";
131130
developmentRegion = en;
132131
hasScannedForEncodings = 0;
133132
knownRegions = (
@@ -136,6 +135,7 @@
136135
);
137136
mainGroup = 437121322469F097000570FA;
138137
minimizedProjectReferenceProxies = 1;
138+
preferredProjectObjectVersion = 77;
139139
productRefGroup = 82E076C727D1037600402C93 /* Products */;
140140
projectDirPath = "";
141141
projectRoot = "";

SketchAPI.xcodeproj/xcshareddata/xcschemes/Sketch API.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1620"
3+
LastUpgradeVersion = "2600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Source/dom/__tests__/find.test.js

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* globals expect, test */
2-
import { find, Rectangle, Group } from '..'
2+
import { find, Rectangle, Group, SymbolMaster, GroupBehavior } from '..'
33

44
test('should find Artboard by type', (_context, document) => {
55
// eslint-disable-next-line no-param-reassign
@@ -266,6 +266,9 @@ test('should find all canvas frames as Artboards', (_context, document) => {
266266
new Group({
267267
name: 'TopLevelFrame->NestedGroup',
268268
}),
269+
new SymbolMaster({
270+
name: 'TopLevelFrame->NestedSymbolMaster',
271+
}),
269272
],
270273
}),
271274
new Group.Graphic({
@@ -274,6 +277,10 @@ test('should find all canvas frames as Artboards', (_context, document) => {
274277
new Group.Frame({
275278
name: 'TopLevelGraphic->NestedFrame',
276279
}),
280+
new SymbolMaster({
281+
name: 'TopLevelGraphic->NestedSymbolMasterGraphic',
282+
groupBehavior: GroupBehavior.Graphic,
283+
}),
277284
],
278285
}),
279286
new Group({
@@ -284,12 +291,21 @@ test('should find all canvas frames as Artboards', (_context, document) => {
284291
}),
285292
],
286293
}),
294+
new SymbolMaster({
295+
name: 'TopLevelSymbolMaster',
296+
}),
297+
new SymbolMaster({
298+
name: 'TopLevelSymbolMasterGraphic',
299+
groupBehavior: GroupBehavior.Graphic,
300+
}),
287301
],
288302
},
289303
]
290304
expect(find('Artboard', document).map((x) => x.name)).toEqual([
291305
'TopLevelFrame',
292306
'TopLevelGraphic',
307+
'TopLevelSymbolMaster',
308+
'TopLevelSymbolMasterGraphic',
293309
])
294310
})
295311

@@ -307,6 +323,9 @@ test('should find all Frames', (_context, document) => {
307323
new Group({
308324
name: 'TopLevelFrame->NestedGroup',
309325
}),
326+
new SymbolMaster({
327+
name: 'TopLevelFrame->NestedSymbolMaster',
328+
}),
310329
],
311330
}),
312331
new Group.Graphic({
@@ -315,6 +334,10 @@ test('should find all Frames', (_context, document) => {
315334
new Group.Frame({
316335
name: 'TopLevelGraphic->NestedFrame',
317336
}),
337+
new SymbolMaster({
338+
name: 'TopLevelGraphic->NestedSymbolMasterGraphic',
339+
groupBehavior: GroupBehavior.Graphic,
340+
}),
318341
],
319342
}),
320343
new Group({
@@ -325,15 +348,26 @@ test('should find all Frames', (_context, document) => {
325348
}),
326349
],
327350
}),
351+
new SymbolMaster({
352+
name: 'TopLevelSymbolMaster',
353+
}),
354+
new SymbolMaster({
355+
name: 'TopLevelSymbolMasterGraphic',
356+
groupBehavior: GroupBehavior.Graphic,
357+
}),
328358
],
329359
},
330360
]
331361
expect(find('Frame', document).map((x) => x.name)).toEqual([
332362
'TopLevelFrame',
333363
'TopLevelFrame->NestedGraphic',
364+
'TopLevelFrame->NestedSymbolMaster',
334365
'TopLevelGraphic',
335366
'TopLevelGraphic->NestedFrame',
367+
'TopLevelGraphic->NestedSymbolMasterGraphic',
336368
'TopLevelGroup->NestedFrame',
369+
'TopLevelSymbolMaster',
370+
'TopLevelSymbolMasterGraphic',
337371
])
338372
})
339373

@@ -351,6 +385,9 @@ test('should find all Graphics', (_context, document) => {
351385
new Group({
352386
name: 'TopLevelFrame->NestedGroup',
353387
}),
388+
new SymbolMaster({
389+
name: 'TopLevelFrame->NestedSymbolMaster',
390+
}),
354391
],
355392
}),
356393
new Group.Graphic({
@@ -359,6 +396,10 @@ test('should find all Graphics', (_context, document) => {
359396
new Group.Frame({
360397
name: 'TopLevelGraphic->NestedFrame',
361398
}),
399+
new SymbolMaster({
400+
name: 'TopLevelGraphic->NestedSymbolMasterGraphic',
401+
groupBehavior: GroupBehavior.Graphic,
402+
}),
362403
],
363404
}),
364405
new Group({
@@ -369,12 +410,21 @@ test('should find all Graphics', (_context, document) => {
369410
}),
370411
],
371412
}),
413+
new SymbolMaster({
414+
name: 'TopLevelSymbolMaster',
415+
}),
416+
new SymbolMaster({
417+
name: 'TopLevelSymbolMasterGraphic',
418+
groupBehavior: GroupBehavior.Graphic,
419+
}),
372420
],
373421
},
374422
]
375423
expect(find('Graphic', document).map((x) => x.name)).toEqual([
376424
'TopLevelFrame->NestedGraphic',
377425
'TopLevelGraphic',
426+
'TopLevelGraphic->NestedSymbolMasterGraphic',
427+
'TopLevelSymbolMasterGraphic',
378428
])
379429
})
380430

@@ -392,6 +442,9 @@ test('should find all (top-level & nested) regular Groups together with nested F
392442
new Group({
393443
name: 'TopLevelFrame->NestedGroup',
394444
}),
445+
new SymbolMaster({
446+
name: 'TopLevelFrame->NestedSymbolMaster',
447+
}),
395448
],
396449
}),
397450
new Group.Graphic({
@@ -400,6 +453,10 @@ test('should find all (top-level & nested) regular Groups together with nested F
400453
new Group.Frame({
401454
name: 'TopLevelGraphic->NestedFrame',
402455
}),
456+
new SymbolMaster({
457+
name: 'TopLevelGraphic->NestedSymbolMasterGraphic',
458+
groupBehavior: GroupBehavior.Graphic,
459+
}),
403460
],
404461
}),
405462
new Group({
@@ -410,6 +467,13 @@ test('should find all (top-level & nested) regular Groups together with nested F
410467
}),
411468
],
412469
}),
470+
new SymbolMaster({
471+
name: 'TopLevelSymbolMaster',
472+
}),
473+
new SymbolMaster({
474+
name: 'TopLevelSymbolMasterGraphic',
475+
groupBehavior: GroupBehavior.Graphic,
476+
}),
413477
],
414478
},
415479
]

Source/dom/__tests__/import.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ test('should create Group from an SVG', () => {
77
'<svg width="200px" height="100px" viewBox="0 0 200 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect fill="#000000" x="0" y="0" width="200" height="100"></rect></svg>'
88

99
const group = createLayerFromData(svgString, 'svg')
10-
expect(group.type).toEqual('Group')
11-
expect(group.groupBehavior).toEqual(2) // Graphic
10+
expect(group.groupBehavior).toBeDefined()
1211
expect(group.layers.length).toEqual(1)
1312
expect(group.layers[0].type).toEqual('ShapePath')
1413
expect(group.layers[0].shapeType).toEqual('Rectangle')
@@ -33,7 +32,7 @@ test('should create group from a PDF', (_context, document) => {
3332
output: null,
3433
})
3534
const imported = createLayerFromData(buffer, 'pdf')
36-
expect(imported.type).toEqual('Group')
35+
expect(imported.groupBehavior).toBeDefined()
3736
expect(imported.frame.width).toEqual(200)
3837
expect(imported.frame.height).toEqual(100)
3938
})

0 commit comments

Comments
 (0)