Skip to content

Commit

Permalink
Add per-document libraries info
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenlaid committed Sep 1, 2022
1 parent 53e03f4 commit 2d515aa
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/popular-laws-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sketch-hq/sketch-file-format': minor
'@sketch-hq/sketch-file-format-ts': minor
---

Add per-document libraries info
3 changes: 3 additions & 0 deletions packages/file-format/schema/abstract-document.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ properties:
items: { $ref: ./objects/font-ref.schema.yaml }
documentState: { $ref: ./objects/document-state.schema.yaml }
patchInfo: { $ref: ./objects/patch-info.schema.yaml }
perDocumentLibraries:
type: array
items: { $ref: ./objects/document-library-info.schema.yaml }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: Document Library Type
description:
Enumeration of the asset library type. Roughly represents all library types
from Preferences... > Libraries tab
type: integer
enum:
- 0
- 1
- 2
enumDescriptions:
- Local
- Workspace
- Third-Party
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Document Library Info
description:
Represents a "reference" to the asset library, that is used in the document
type: object
optional:
- name
- appcastURL
- documentID
- shareID
- workspaceName
properties:
_class: { const: MSImmutableDocumentLibraryInfo }
libraryType: { $ref: ../enums/document-library-type.schema.yaml }
name: { type: string }
appcastURL: { type: string }
documentID: { $ref: ./utils/uuid.schema.yaml }
shareID: { $ref: ./utils/uuid.schema.yaml }
workspaceName: { type: string }
1 change: 1 addition & 0 deletions packages/file/src/__tests__/file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('toFile', () => {
do_objectID: 'b08e8447-b31d-4901-abb7-8284e1f71113',
},
pages: [blankPage],
perDocumentLibraries: []
},
meta: {
app: FileFormat.BundleId.Testing,
Expand Down

0 comments on commit 2d515aa

Please sign in to comment.