@dxtmisha/wiki 0.57.1 → 0.57.4
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/dist/{defineProperty-3CuEayIP.js → defineProperty-Dcl1xgfx.js} +4 -4
- package/dist/library.js +2 -1
- package/dist/storybook.js +1 -1
- package/package.json +1 -1
- package/src/media/functional/figma/classes/FigmaPostAbstract/FigmaPostAbstract.en.mdx +46 -0
- package/src/media/functional/figma/classes/FigmaPostAbstract/FigmaPostAbstract.ru.mdx +46 -0
- package/src/media/functional/figma/classes/FigmaPostAbstract/FigmaPostAbstract.vi.mdx +46 -0
- package/src/media/functional/figma/classes/FigmaPostCode/FigmaPostCode.en.mdx +3 -23
- package/src/media/functional/figma/classes/FigmaPostCode/FigmaPostCode.ru.mdx +3 -23
- package/src/media/functional/figma/classes/FigmaPostCode/FigmaPostCode.vi.mdx +3 -23
- package/src/media/functional/figma/functions/fetchClientStorage/fetchClientStorage.en.mdx +46 -0
- package/src/media/functional/figma/functions/fetchClientStorage/fetchClientStorage.ru.mdx +46 -0
- package/src/media/functional/figma/functions/fetchClientStorage/fetchClientStorage.vi.mdx +46 -0
- package/src/media/functional/figma/functions/fetchFrameSelection/fetchFrameSelection.en.mdx +34 -0
- package/src/media/functional/figma/functions/fetchFrameSelection/fetchFrameSelection.ru.mdx +34 -0
- package/src/media/functional/figma/functions/fetchFrameSelection/fetchFrameSelection.vi.mdx +34 -0
- package/src/media/functional/figma/functions/fetchFrameStyles/fetchFrameStyles.en.mdx +49 -0
- package/src/media/functional/figma/functions/fetchFrameStyles/fetchFrameStyles.ru.mdx +49 -0
- package/src/media/functional/figma/functions/fetchFrameStyles/fetchFrameStyles.vi.mdx +49 -0
- package/src/media/functional/figma/functions/fetchFramesSelected/fetchFramesSelected.en.mdx +19 -8
- package/src/media/functional/figma/functions/fetchFramesSelected/fetchFramesSelected.ru.mdx +18 -7
- package/src/media/functional/figma/functions/fetchFramesSelected/fetchFramesSelected.vi.mdx +19 -8
- package/src/media/functional/figma/functions/fetchStorage/fetchStorage.en.mdx +42 -0
- package/src/media/functional/figma/functions/fetchStorage/fetchStorage.ru.mdx +42 -0
- package/src/media/functional/figma/functions/fetchStorage/fetchStorage.vi.mdx +42 -0
- package/src/media/functional/figma/functions/fetchTopLevelFrames/fetchTopLevelFrames.en.mdx +29 -7
- package/src/media/functional/figma/functions/fetchTopLevelFrames/fetchTopLevelFrames.ru.mdx +28 -6
- package/src/media/functional/figma/functions/fetchTopLevelFrames/fetchTopLevelFrames.vi.mdx +29 -7
- package/src/media/functional/figma/functions/sendClientStorage/sendClientStorage.en.mdx +29 -0
- package/src/media/functional/figma/functions/sendClientStorage/sendClientStorage.ru.mdx +29 -0
- package/src/media/functional/figma/functions/sendClientStorage/sendClientStorage.vi.mdx +29 -0
- package/src/media/functional/figma/functions/sendFrameSelection/sendFrameSelection.en.mdx +28 -0
- package/src/media/functional/figma/functions/sendFrameSelection/sendFrameSelection.ru.mdx +28 -0
- package/src/media/functional/figma/functions/sendFrameSelection/sendFrameSelection.vi.mdx +28 -0
- package/src/media/functional/figma/functions/sendFrameStyles/sendFrameStyles.en.mdx +40 -0
- package/src/media/functional/figma/functions/sendFrameStyles/sendFrameStyles.ru.mdx +40 -0
- package/src/media/functional/figma/functions/sendFrameStyles/sendFrameStyles.vi.mdx +40 -0
- package/src/media/functional/figma/functions/sendFramesSelected/sendFramesSelected.en.mdx +29 -0
- package/src/media/functional/figma/functions/sendFramesSelected/sendFramesSelected.ru.mdx +29 -0
- package/src/media/functional/figma/functions/sendFramesSelected/sendFramesSelected.vi.mdx +29 -0
- package/src/media/functional/figma/functions/sendStorage/sendStorage.en.mdx +30 -0
- package/src/media/functional/figma/functions/sendStorage/sendStorage.ru.mdx +30 -0
- package/src/media/functional/figma/functions/sendStorage/sendStorage.vi.mdx +30 -0
- package/src/media/functional/figma-code/classes/FigmaClientStorage/FigmaClientStorage.en.mdx +64 -0
- package/src/media/functional/figma-code/classes/FigmaClientStorage/FigmaClientStorage.ru.mdx +64 -0
- package/src/media/functional/figma-code/classes/FigmaClientStorage/FigmaClientStorage.vi.mdx +64 -0
- package/src/media/functional/figma-code/classes/FigmaFrame/FigmaFrame.en.mdx +168 -35
- package/src/media/functional/figma-code/classes/FigmaFrame/FigmaFrame.ru.mdx +168 -35
- package/src/media/functional/figma-code/classes/FigmaFrame/FigmaFrame.vi.mdx +168 -35
- package/src/media/functional/figma-code/classes/FigmaFramesSelected/FigmaFramesSelected.en.mdx +23 -69
- package/src/media/functional/figma-code/classes/FigmaFramesSelected/FigmaFramesSelected.ru.mdx +22 -68
- package/src/media/functional/figma-code/classes/FigmaFramesSelected/FigmaFramesSelected.vi.mdx +23 -69
- package/src/media/functional/figma-code/classes/FigmaItem/FigmaItem.en.mdx +79 -56
- package/src/media/functional/figma-code/classes/FigmaItem/FigmaItem.ru.mdx +79 -56
- package/src/media/functional/figma-code/classes/FigmaItem/FigmaItem.vi.mdx +79 -56
- package/src/media/functional/figma-code/classes/FigmaPluginMessenger/FigmaPluginMessenger.en.mdx +18 -48
- package/src/media/functional/figma-code/classes/FigmaPluginMessenger/FigmaPluginMessenger.ru.mdx +18 -48
- package/src/media/functional/figma-code/classes/FigmaPluginMessenger/FigmaPluginMessenger.vi.mdx +18 -48
- package/src/media/functional/figma-code/classes/FigmaStorage/FigmaStorage.en.mdx +22 -67
- package/src/media/functional/figma-code/classes/FigmaStorage/FigmaStorage.ru.mdx +22 -67
- package/src/media/functional/figma-code/classes/FigmaStorage/FigmaStorage.vi.mdx +22 -67
- package/src/media/functional/figma-code/classes/FigmaStorageData/FigmaStorageData.en.mdx +57 -0
- package/src/media/functional/figma-code/classes/FigmaStorageData/FigmaStorageData.ru.mdx +57 -0
- package/src/media/functional/figma-code/classes/FigmaStorageData/FigmaStorageData.vi.mdx +57 -0
- package/src/media/functional/figma-code/classes/FigmaTopLevelFrames/FigmaTopLevelFrames.en.mdx +24 -27
- package/src/media/functional/figma-code/classes/FigmaTopLevelFrames/FigmaTopLevelFrames.ru.mdx +23 -26
- package/src/media/functional/figma-code/classes/FigmaTopLevelFrames/FigmaTopLevelFrames.vi.mdx +24 -27
- package/src/media/functional/figma-code/functions/getFigmaFrameById/getFigmaFrameById.en.mdx +28 -0
- package/src/media/functional/figma-code/functions/getFigmaFrameById/getFigmaFrameById.ru.mdx +28 -0
- package/src/media/functional/figma-code/functions/getFigmaFrameById/getFigmaFrameById.vi.mdx +28 -0
- package/src/media/functional/figma-code/functions/getFigmaItemById/getFigmaItemById.en.mdx +43 -0
- package/src/media/functional/figma-code/functions/getFigmaItemById/getFigmaItemById.ru.mdx +43 -0
- package/src/media/functional/figma-code/functions/getFigmaItemById/getFigmaItemById.vi.mdx +43 -0
- package/src/media/functional/figma-code/functions/getFigmaItemByIdOrRoot/getFigmaItemByIdOrRoot.en.mdx +30 -0
- package/src/media/functional/figma-code/functions/getFigmaItemByIdOrRoot/getFigmaItemByIdOrRoot.ru.mdx +30 -0
- package/src/media/functional/figma-code/functions/getFigmaItemByIdOrRoot/getFigmaItemByIdOrRoot.vi.mdx +30 -0
- package/src/media/functional/figma-code/functions/makeFigmaFrameSelection/makeFigmaFrameSelection.en.mdx +21 -0
- package/src/media/functional/figma-code/functions/makeFigmaFrameSelection/makeFigmaFrameSelection.ru.mdx +21 -0
- package/src/media/functional/figma-code/functions/makeFigmaFrameSelection/makeFigmaFrameSelection.vi.mdx +21 -0
- package/src/media/functional/figma-code/functions/makeFigmaTexts/makeFigmaTexts.en.mdx +28 -0
- package/src/media/functional/figma-code/functions/makeFigmaTexts/makeFigmaTexts.ru.mdx +28 -0
- package/src/media/functional/figma-code/functions/makeFigmaTexts/makeFigmaTexts.vi.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupClientStorage/setupClientStorage.en.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupClientStorage/setupClientStorage.ru.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupClientStorage/setupClientStorage.vi.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupFrameSelection/setupFrameSelection.en.mdx +22 -0
- package/src/media/functional/figma-code/functions/setupFrameSelection/setupFrameSelection.ru.mdx +22 -0
- package/src/media/functional/figma-code/functions/setupFrameSelection/setupFrameSelection.vi.mdx +22 -0
- package/src/media/functional/figma-code/functions/setupFrameStyles/setupFrameStyles.en.mdx +19 -0
- package/src/media/functional/figma-code/functions/setupFrameStyles/setupFrameStyles.ru.mdx +19 -0
- package/src/media/functional/figma-code/functions/setupFrameStyles/setupFrameStyles.vi.mdx +19 -0
- package/src/media/functional/figma-code/functions/setupStorage/setupStorage.en.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupStorage/setupStorage.ru.mdx +28 -0
- package/src/media/functional/figma-code/functions/setupStorage/setupStorage.vi.mdx +28 -0
- package/src/media/functional/figma-code/functions/toFrameSelection/toFrameSelection.en.mdx +27 -0
- package/src/media/functional/figma-code/functions/toFrameSelection/toFrameSelection.ru.mdx +27 -0
- package/src/media/functional/figma-code/functions/toFrameSelection/toFrameSelection.vi.mdx +27 -0
- package/src/media/functional/figma-ref/composables/useFigmaClientStorage/useFigmaClientStorage.en.mdx +26 -0
- package/src/media/functional/figma-ref/composables/useFigmaClientStorage/useFigmaClientStorage.ru.mdx +26 -0
- package/src/media/functional/figma-ref/composables/useFigmaClientStorage/useFigmaClientStorage.vi.mdx +26 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameSelection/useFigmaFrameSelection.en.mdx +35 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameSelection/useFigmaFrameSelection.ru.mdx +35 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameSelection/useFigmaFrameSelection.vi.mdx +35 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameStyles/useFigmaFrameStyles.en.mdx +33 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameStyles/useFigmaFrameStyles.ru.mdx +33 -0
- package/src/media/functional/figma-ref/composables/useFigmaFrameStyles/useFigmaFrameStyles.vi.mdx +33 -0
- package/src/media/functional/figma-ref/composables/useFigmaStorage/useFigmaStorage.en.mdx +28 -0
- package/src/media/functional/figma-ref/composables/useFigmaStorage/useFigmaStorage.ru.mdx +28 -0
- package/src/media/functional/figma-ref/composables/useFigmaStorage/useFigmaStorage.vi.mdx +28 -0
- package/src/media/functional/figma-ref/composables/useFigmaUiFrames/useFigmaUiFrames.en.mdx +7 -12
- package/src/media/functional/figma-ref/composables/useFigmaUiFrames/useFigmaUiFrames.ru.mdx +7 -12
- package/src/media/functional/figma-ref/composables/useFigmaUiFrames/useFigmaUiFrames.vi.mdx +8 -13
- package/src/media/functional/figma-ref/composables/useFigmaUiSelected/useFigmaUiSelected.en.mdx +12 -17
- package/src/media/functional/figma-ref/composables/useFigmaUiSelected/useFigmaUiSelected.ru.mdx +13 -18
- package/src/media/functional/figma-ref/composables/useFigmaUiSelected/useFigmaUiSelected.vi.mdx +14 -19
- package/src/media/functional/functional/composables/useApiAsyncRef/useApiAsyncRef.en.mdx +2 -3
- package/src/media/functional/functional/composables/useApiAsyncRef/useApiAsyncRef.ru.mdx +2 -3
- package/src/media/functional/functional/composables/useApiAsyncRef/useApiAsyncRef.vi.mdx +2 -3
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementAsyncRef.en.mdx +41 -0
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementAsyncRef.ru.mdx +41 -0
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementAsyncRef.vi.mdx +41 -0
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementRef.en.mdx +12 -0
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementRef.ru.mdx +12 -0
- package/src/media/functional/functional/composables/useApiManagementRef/useApiManagementRef.vi.mdx +6 -0
- package/src/media/functional/functional/composables/useApiRef/useApiRef.en.mdx +12 -9
- package/src/media/functional/functional/composables/useApiRef/useApiRef.ru.mdx +12 -9
- package/src/media/functional/functional/composables/useApiRef/useApiRef.vi.mdx +11 -9
- package/src/media/functional/nitro-basic/functions/getInject.en.mdx +27 -0
- package/src/media/functional/nitro-basic/functions/getInject.ru.mdx +27 -0
- package/src/media/functional/nitro-basic/functions/getInject.vi.mdx +20 -0
- package/src/media/functional/ui-figma/about/about.en.mdx +52 -0
- package/src/media/functional/ui-figma/about/about.ru.mdx +52 -0
- package/src/media/functional/ui-figma/about/about.vi.mdx +52 -0
- package/src/media/functional/ui-figma/frames/frames.en.mdx +58 -0
- package/src/media/functional/ui-figma/frames/frames.ru.mdx +58 -0
- package/src/media/functional/ui-figma/frames/frames.vi.mdx +58 -0
- package/src/media/functional/ui-figma/messenger/messenger.en.mdx +67 -0
- package/src/media/functional/ui-figma/messenger/messenger.ru.mdx +67 -0
- package/src/media/functional/ui-figma/messenger/messenger.vi.mdx +67 -0
- package/src/media/functional/ui-figma/selection/selection.en.mdx +65 -0
- package/src/media/functional/ui-figma/selection/selection.ru.mdx +65 -0
- package/src/media/functional/ui-figma/selection/selection.vi.mdx +65 -0
- package/src/media/functional/ui-figma/storage/storage.en.mdx +53 -0
- package/src/media/functional/ui-figma/storage/storage.ru.mdx +53 -0
- package/src/media/functional/ui-figma/storage/storage.vi.mdx +53 -0
- package/src/media/functional/ui-figma/styles/styles.en.mdx +57 -0
- package/src/media/functional/ui-figma/styles/styles.ru.mdx +57 -0
- package/src/media/functional/ui-figma/styles/styles.vi.mdx +57 -0
- /package/src/media/functional/ui/{wiki-data.en.mdx → wiki/wiki-data.en.mdx} +0 -0
- /package/src/media/functional/ui/{wiki-data.ru.mdx → wiki/wiki-data.ru.mdx} +0 -0
- /package/src/media/functional/ui/{wiki-data.vi.mdx → wiki/wiki-data.vi.mdx} +0 -0
|
@@ -1,73 +1,96 @@
|
|
|
1
|
-
import {Meta} from '@storybook/addon-docs/blocks'
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title='@dxtmisha/en/figma-code/Classes/FigmaItem -
|
|
3
|
+
<Meta title='@dxtmisha/en/figma-code/Classes/FigmaItem - Figma node wrapper'/>
|
|
4
4
|
|
|
5
|
-
# FigmaItem
|
|
5
|
+
# Class `FigmaItem`
|
|
6
6
|
|
|
7
|
-
A wrapper class for
|
|
7
|
+
A versatile wrapper class for interacting with any type of Figma node. It provides typed methods for type checking, tree navigation, and common operations such as exporting and viewport management.
|
|
8
8
|
|
|
9
9
|
## Key Features
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **Content Analysis** — Specialized logic for extracting and validating text content.
|
|
11
|
+
- **Type Safety** — Utilizes Type Guards (`isFrame`, `isText`, etc.) for safe access to properties specific to certain node types.
|
|
12
|
+
- **Fluent Navigation** — Convenient methods for retrieving parent elements or child nodes already wrapped in `FigmaItem` instances.
|
|
13
|
+
- **Integrated Actions** — Built-in support for exporting nodes to JPG/JSON and controlling the Figma viewport (selection and zoom).
|
|
15
14
|
|
|
16
15
|
## Initialization
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Generic Constraints
|
|
21
|
-
|
|
22
|
-
The class supports a generic parameter for strict typing:
|
|
23
|
-
- `T extends UiFigmaNode` — The specific type of the wrapped Figma node.
|
|
24
|
-
|
|
25
|
-
**Parameters:**
|
|
26
|
-
- `item: T` — The native Figma node (e.g., `SceneNode`, `FrameNode`, `TextNode`) to be wrapped.
|
|
17
|
+
Wrap any Figma node in a `FigmaItem` instance to access its helper methods.
|
|
27
18
|
|
|
28
19
|
```typescript
|
|
29
20
|
import { FigmaItem } from '@dxtmisha/figma-code'
|
|
30
21
|
|
|
31
|
-
//
|
|
22
|
+
// Wrap a node (e.g., from selection)
|
|
32
23
|
const item = new FigmaItem(figma.currentPage.selection[0])
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
if (item.isFrame()) {
|
|
26
|
+
console.log('Node is a frame:', item.getName())
|
|
27
|
+
}
|
|
36
28
|
```
|
|
37
29
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
30
|
+
## Methods
|
|
31
|
+
|
|
32
|
+
### Type Guards
|
|
33
|
+
|
|
34
|
+
- `isDocument(): boolean` — Checks if the node is a Document.
|
|
35
|
+
- `isFrame(): boolean` — Checks if the node is a Frame.
|
|
36
|
+
- `isSection(): boolean` — Checks if the node is a Section.
|
|
37
|
+
- `isText(): boolean` — Checks if the node is a Text node.
|
|
38
|
+
- `isTextNoValue(): boolean` — Checks if the node is a text node with meaningful content.
|
|
39
|
+
- `inCurrentPage(): boolean` — Checks if the node belongs to the current active page.
|
|
40
|
+
|
|
41
|
+
### Hierarchy and Navigation
|
|
42
|
+
|
|
43
|
+
- `get(): T` — Returns the original Figma node.
|
|
44
|
+
- `getParent(): UiFigmaNode | undefined` — Returns the original parent node.
|
|
45
|
+
- `getParentItem(): FigmaItem | undefined` — Returns the parent node wrapped in `FigmaItem`.
|
|
46
|
+
- `getParentPage(): PageNode | undefined` — Returns the parent page of the node.
|
|
47
|
+
- `getParentPageItem(): FigmaItem | undefined` — Returns the parent page wrapped in `FigmaItem`.
|
|
48
|
+
- `getChildren(): UiFigmaNode[]` — Returns the list of child nodes in original format.
|
|
49
|
+
- `getChildrenItems(): FigmaItem[]` — Returns all child nodes wrapped in `FigmaItem`.
|
|
50
|
+
|
|
51
|
+
### Content and Information
|
|
52
|
+
|
|
53
|
+
- `getId(): string` — Returns the unique identifier of the node.
|
|
54
|
+
- `getName(): string` — Returns the name of the node.
|
|
55
|
+
- `getType(): string` — Returns the node type string.
|
|
56
|
+
- `getText(): string` — Returns the text content (for text nodes only).
|
|
57
|
+
- `getInfo(): Promise<UiFigmaFramesItem>` — Asynchronously collects basic node information (name, ID, screenshot).
|
|
58
|
+
- `getCss(): Promise<Record<string, string>>` — Asynchronously extracts CSS styles of the node.
|
|
59
|
+
- `getStyles(): Promise<UiFigmaFrameStylesItem>` — Asynchronously extracts extended style information (CSS, text, JSON).
|
|
60
|
+
|
|
61
|
+
### Export and Actions
|
|
62
|
+
|
|
63
|
+
- `exportJpg(): Promise<Uint8Array>` — Exports the node as a JPG image.
|
|
64
|
+
- `exportJson(): Promise<any>` — Exports full node data in JSON format.
|
|
65
|
+
- `exportJsonCompact(): Promise<UiFigmaFrameStylesData | undefined>` — Exports node data in a compact JSON format.
|
|
66
|
+
- `toSelection(): void` — Selects the node and focuses the viewport on it.
|
|
67
|
+
- `toPageAndSelection(): Promise<void>` — Switches to the node's page and selects it.
|
|
68
|
+
|
|
69
|
+
## Data Types
|
|
70
|
+
|
|
71
|
+
#### `UiFigmaFramesItem`
|
|
72
|
+
Simplified information about an element for display in the interface.
|
|
73
|
+
- `name: string` — The name of the element in Figma.
|
|
74
|
+
- `id: string` — The unique identifier of the node.
|
|
75
|
+
- `image?: Uint8Array | string` — A screenshot of the element (binary data or base64).
|
|
76
|
+
|
|
77
|
+
#### `UiFigmaFrameStylesItem`
|
|
78
|
+
Extended information about an element, including its styles. Inherits all fields from `UiFigmaFramesItem`.
|
|
79
|
+
- `json?: UiFigmaFrameStylesData` — Node data and styles structure in JSON format.
|
|
80
|
+
- `text?: string` — Text content (if the node is a text node).
|
|
81
|
+
- `styles?: Record<string, string>` — An object with CSS properties of the element itself.
|
|
82
|
+
- `childrenStyles?: Record<string, Record<string, string>>` — A map of CSS styles for all child elements, indexed by their ID.
|
|
83
|
+
|
|
84
|
+
#### `UiFigmaFrameStylesData`
|
|
85
|
+
- `document: UiFigmaFrameStylesJson` — Node tree in a compact format.
|
|
86
|
+
- `styles: Record<string, any>` — A dictionary of document style definitions.
|
|
87
|
+
|
|
88
|
+
#### `UiFigmaFrameStylesJson`
|
|
89
|
+
Compact representation of a Figma node for JSON export.
|
|
90
|
+
- `id: string` — Unique identifier of the node.
|
|
91
|
+
- `name: string` — Name of the node.
|
|
92
|
+
- `type: string` — Type of the node.
|
|
93
|
+
- `characters?: string` — Text (for text nodes).
|
|
94
|
+
- `children?: UiFigmaFrameStylesJson[]` — Recursive list of child elements.
|
|
95
|
+
- `style?: Record<string, any>` — Appearance parameters.
|
|
96
|
+
- `styles?: Record<string, any>` — Associated styles.
|
|
@@ -1,73 +1,96 @@
|
|
|
1
|
-
import {Meta} from '@storybook/addon-docs/blocks'
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title='@dxtmisha/ru/figma-code/Classes/FigmaItem - Обертка
|
|
3
|
+
<Meta title='@dxtmisha/ru/figma-code/Classes/FigmaItem - Обертка для узлов Figma'/>
|
|
4
4
|
|
|
5
|
-
# Класс FigmaItem
|
|
5
|
+
# Класс `FigmaItem`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Универсальный класс-обертка для работы с любыми типами узлов Figma. Предоставляет типизированные методы для проверки типов, навигации по дереву элементов и выполнения частых операций, таких как экспорт и управление вьюпортом.
|
|
8
8
|
|
|
9
9
|
## Ключевые особенности
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- **Анализ контента** — Специализированная логика для извлечения и валидации текстового содержимого.
|
|
11
|
+
- **Типобезопасность** — Использует Type Guards (`isFrame`, `isText` и т. д.) для безопасного доступа к свойствам конкретных типов узлов.
|
|
12
|
+
- **Удобная навигация** — Методы для получения родительских элементов или дочерних узлов, уже обернутых в экземпляры `FigmaItem`.
|
|
13
|
+
- **Встроенные действия** — Поддержка экспорта узлов в JPG/JSON и управления вьюпортом Figma (выделение и масштабирование).
|
|
15
14
|
|
|
16
15
|
## Инициализация
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Ограничения универсальных типов (Generics)
|
|
21
|
-
|
|
22
|
-
Класс поддерживает параметр универсального типа для строгой типизации:
|
|
23
|
-
- `T extends UiFigmaNode` — Конкретный тип обернутого узла Figma.
|
|
24
|
-
|
|
25
|
-
**Параметры:**
|
|
26
|
-
- `item: T` — Нативный узел Figma (например, `SceneNode`, `FrameNode`, `TextNode`), который необходимо обернуть.
|
|
17
|
+
Оберните любой узел Figma в экземпляр `FigmaItem`, чтобы получить доступ к его вспомогательным методам.
|
|
27
18
|
|
|
28
19
|
```typescript
|
|
29
20
|
import { FigmaItem } from '@dxtmisha/figma-code'
|
|
30
21
|
|
|
31
|
-
//
|
|
22
|
+
// Обертывание узла (например, из выделения)
|
|
32
23
|
const item = new FigmaItem(figma.currentPage.selection[0])
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
if (item.isFrame()) {
|
|
26
|
+
console.log('Узел является фреймом:', item.getName())
|
|
27
|
+
}
|
|
36
28
|
```
|
|
37
29
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
30
|
+
## Методы
|
|
31
|
+
|
|
32
|
+
### Проверка типов
|
|
33
|
+
|
|
34
|
+
- `isDocument(): boolean` — Проверяет, является ли узел документом.
|
|
35
|
+
- `isFrame(): boolean` — Проверяет, является ли узел фреймом.
|
|
36
|
+
- `isSection(): boolean` — Проверяет, является ли узел секцией.
|
|
37
|
+
- `isText(): boolean` — Проверяет, является ли узел текстовым узлом.
|
|
38
|
+
- `isTextNoValue(): boolean` — Проверяет, является ли узел текстовым узлом с осмысленным содержанием.
|
|
39
|
+
- `inCurrentPage(): boolean` — Проверяет, принадлежит ли узел текущей активной странице.
|
|
40
|
+
|
|
41
|
+
### Иерархия и навигация
|
|
42
|
+
|
|
43
|
+
- `get(): T` — Возвращает исходный узел Figma.
|
|
44
|
+
- `getParent(): UiFigmaNode | undefined` — Возвращает исходный родительский узел.
|
|
45
|
+
- `getParentItem(): FigmaItem | undefined` — Возвращает родительский узел, обернутый в `FigmaItem`.
|
|
46
|
+
- `getParentPage(): PageNode | undefined` — Возвращает родительскую страницу узла.
|
|
47
|
+
- `getParentPageItem(): FigmaItem | undefined` — Возвращает родительскую страницу, обернутую в `FigmaItem`.
|
|
48
|
+
- `getChildren(): UiFigmaNode[]` — Возвращает список дочерних узлов в исходном формате.
|
|
49
|
+
- `getChildrenItems(): FigmaItem[]` — Возвращает все дочерние узлы, обернутые в `FigmaItem`.
|
|
50
|
+
|
|
51
|
+
### Контент и информация
|
|
52
|
+
|
|
53
|
+
- `getId(): string` — Возвращает уникальный идентификатор узла.
|
|
54
|
+
- `getName(): string` — Возвращает имя узла.
|
|
55
|
+
- `getType(): string` — Возвращает строку с типом узла.
|
|
56
|
+
- `getText(): string` — Возвращает текстовое содержимое (только для текстовых узлов).
|
|
57
|
+
- `getInfo(): Promise<UiFigmaFramesItem>` — Асинхронно собирает базовую информацию об узле (имя, ID, скриншот).
|
|
58
|
+
- `getCss(): Promise<Record<string, string>>` — Асинхронно извлекает CSS-стили текущего узла.
|
|
59
|
+
- `getStyles(): Promise<UiFigmaFrameStylesItem>` — Асинхронно извлекает расширенную информацию о стилях (CSS, текст, JSON).
|
|
60
|
+
|
|
61
|
+
### Экспорт и действия
|
|
62
|
+
|
|
63
|
+
- `exportJpg(): Promise<Uint8Array>` — Экспортирует узел как изображение JPG.
|
|
64
|
+
- `exportJson(): Promise<any>` — Экспортирует полные данные узла в формате JSON.
|
|
65
|
+
- `exportJsonCompact(): Promise<UiFigmaFrameStylesData | undefined>` — Экспортирует данные узла в компактном формате JSON.
|
|
66
|
+
- `toSelection(): void` — Выделяет узел и фокусирует на нем вьюпорт.
|
|
67
|
+
- `toPageAndSelection(): Promise<void>` — Переключается на страницу узла и выделяет его.
|
|
68
|
+
|
|
69
|
+
## Типы данных
|
|
70
|
+
|
|
71
|
+
#### `UiFigmaFramesItem`
|
|
72
|
+
Базовая информация об элементе для отображения в интерфейсе.
|
|
73
|
+
- `name: string` — Название элемента в Figma.
|
|
74
|
+
- `id: string` — Уникальный идентификатор узла.
|
|
75
|
+
- `image?: Uint8Array | string` — Скриншот элемента (бинарные данные или base64).
|
|
76
|
+
|
|
77
|
+
#### `UiFigmaFrameStylesItem`
|
|
78
|
+
Расширенная информация об элементе, включая его стили. Наследует все поля `UiFigmaFramesItem`.
|
|
79
|
+
- `json?: UiFigmaFrameStylesData` — Структура данных узла и стилей в формате JSON.
|
|
80
|
+
- `text?: string` — Текстовое содержимое (если узел является текстовым).
|
|
81
|
+
- `styles?: Record<string, string>` — Объект с CSS-свойствами самого элемента.
|
|
82
|
+
- `childrenStyles?: Record<string, Record<string, string>>` — Карта CSS-стилей для всех дочерних элементов, индексированная по их ID.
|
|
83
|
+
|
|
84
|
+
#### `UiFigmaFrameStylesData`
|
|
85
|
+
- `document: UiFigmaFrameStylesJson` — Дерево узлов в компактном формате.
|
|
86
|
+
- `styles: Record<string, any>` — Словарь определений стилей документа.
|
|
87
|
+
|
|
88
|
+
#### `UiFigmaFrameStylesJson`
|
|
89
|
+
Компактное представление узла Figma для JSON-экспорта.
|
|
90
|
+
- `id: string` — Уникальный идентификатор узла.
|
|
91
|
+
- `name: string` — Имя узла.
|
|
92
|
+
- `type: string` — Тип узла.
|
|
93
|
+
- `characters?: string` — Текст (для текстовых узлов).
|
|
94
|
+
- `children?: UiFigmaFrameStylesJson[]` — Рекурсивный список дочерних элементов.
|
|
95
|
+
- `style?: Record<string, any>` — Параметры оформления.
|
|
96
|
+
- `styles?: Record<string, any>` — Связанные стили.
|
|
@@ -1,73 +1,96 @@
|
|
|
1
|
-
import {Meta} from '@storybook/addon-docs/blocks'
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title='@dxtmisha/vi/figma-code/Classes/FigmaItem -
|
|
3
|
+
<Meta title='@dxtmisha/vi/figma-code/Classes/FigmaItem - Lớp bọc node Figma'/>
|
|
4
4
|
|
|
5
|
-
# Lớp FigmaItem
|
|
5
|
+
# Lớp `FigmaItem`
|
|
6
6
|
|
|
7
|
-
Một lớp
|
|
7
|
+
Một lớp bọc đa năng để tương tác với bất kỳ loại node Figma nào. Nó cung cấp các phương thức được định kiểu để kiểm tra kiểu, điều hướng cây node và các hoạt động phổ biến như xuất dữ liệu và quản lý khung nhìn (viewport).
|
|
8
8
|
|
|
9
9
|
## Các tính năng chính
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **Điều hướng
|
|
13
|
-
- **
|
|
14
|
-
- **Phân tích nội dung** — Logic chuyên biệt để trích xuất và xác thực nội dung văn bản.
|
|
11
|
+
- **An toàn kiểu dữ liệu** — Sử dụng Type Guards (`isFrame`, `isText`, v.v.) để truy cập an toàn vào các thuộc tính cụ thể của một số loại node.
|
|
12
|
+
- **Điều hướng linh hoạt** — Các phương thức thuận tiện để truy xuất các phần tử cha hoặc các node con đã được bọc trong các thực thể `FigmaItem`.
|
|
13
|
+
- **Hành động tích hợp** — Hỗ trợ tích hợp để xuất các node sang JPG/JSON và điều khiển khung nhìn Figma (lựa chọn và thu phóng).
|
|
15
14
|
|
|
16
15
|
## Khởi tạo
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Ràng buộc Generics
|
|
21
|
-
|
|
22
|
-
Lớp hỗ trợ một tham số generic để định kiểu nghiêm ngặt:
|
|
23
|
-
- `T extends UiFigmaNode` — Loại cụ thể của node Figma được bọc.
|
|
24
|
-
|
|
25
|
-
**Tham số:**
|
|
26
|
-
- `item: T` — Node Figma gốc (ví dụ: `SceneNode`, `FrameNode`, `TextNode`) cần được bọc.
|
|
17
|
+
Bọc bất kỳ node Figma nào trong một thực thể `FigmaItem` để truy cập các phương thức hỗ trợ của nó.
|
|
27
18
|
|
|
28
19
|
```typescript
|
|
29
20
|
import { FigmaItem } from '@dxtmisha/figma-code'
|
|
30
21
|
|
|
31
|
-
//
|
|
22
|
+
// Bọc một node (ví dụ: từ vùng lựa chọn)
|
|
32
23
|
const item = new FigmaItem(figma.currentPage.selection[0])
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
if (item.isFrame()) {
|
|
26
|
+
console.log('Node là một frame:', item.getName())
|
|
27
|
+
}
|
|
36
28
|
```
|
|
37
29
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
30
|
+
## Các phương thức
|
|
31
|
+
|
|
32
|
+
### Kiểm tra kiểu (Type Guards)
|
|
33
|
+
|
|
34
|
+
- `isDocument(): boolean` — Kiểm tra xem node là Document.
|
|
35
|
+
- `isFrame(): boolean` — Kiểm tra xem node là Frame.
|
|
36
|
+
- `isSection(): boolean` — Kiểm tra xem node là Section.
|
|
37
|
+
- `isText(): boolean` — Kiểm tra xem node là Text node.
|
|
38
|
+
- `isTextNoValue(): boolean` — Kiểm tra xem node có nội dung ý nghĩa hay không.
|
|
39
|
+
- `inCurrentPage(): boolean` — Kiểm tra xem node có thuộc trang đang hoạt động hay không.
|
|
40
|
+
|
|
41
|
+
### Hệ thống cấp bậc và Điều hướng
|
|
42
|
+
|
|
43
|
+
- `get(): T` — Trả về node Figma gốc.
|
|
44
|
+
- `getParent(): UiFigmaNode | undefined` — Trả về node cha gốc.
|
|
45
|
+
- `getParentItem(): FigmaItem | undefined` — Trả về node cha được bọc trong `FigmaItem`.
|
|
46
|
+
- `getParentPage(): PageNode | undefined` — Trả về trang cha của node.
|
|
47
|
+
- `getParentPageItem(): FigmaItem | undefined` — Trả về trang cha được bọc trong `FigmaItem`.
|
|
48
|
+
- `getChildren(): UiFigmaNode[]` — Trả về danh sách các node con ở định dạng gốc.
|
|
49
|
+
- `getChildrenItems(): FigmaItem[]` — Trả về tất cả các node con được bọc trong `FigmaItem`.
|
|
50
|
+
|
|
51
|
+
### Nội dung và Thông tin
|
|
52
|
+
|
|
53
|
+
- `getId(): string` — Trả về mã định danh duy nhất của node.
|
|
54
|
+
- `getName(): string` — Trả về tên của node.
|
|
55
|
+
- `getType(): string` — Trả về chuỗi kiểu node.
|
|
56
|
+
- `getText(): string` — Trả về nội dung văn bản (chỉ dành cho text node).
|
|
57
|
+
- `getInfo(): Promise<UiFigmaFramesItem>` — Thu thập thông tin cơ bản về node (tên, ID, ảnh chụp màn hình) một cách không đồng bộ.
|
|
58
|
+
- `getCss(): Promise<Record<string, string>>` — Trích xuất các style CSS của node một cách không đồng bộ.
|
|
59
|
+
- `getStyles(): Promise<UiFigmaFrameStylesItem>` — Trích xuất thông tin style mở rộng (CSS, văn bản, JSON) một cách không đồng bộ.
|
|
60
|
+
|
|
61
|
+
### Xuất và Hành động
|
|
62
|
+
|
|
63
|
+
- `exportJpg(): Promise<Uint8Array>` — Xuất node dưới dạng hình ảnh JPG.
|
|
64
|
+
- `exportJson(): Promise<any>` — Xuất dữ liệu node đầy đủ ở định dạng JSON.
|
|
65
|
+
- `exportJsonCompact(): Promise<UiFigmaFrameStylesData | undefined>` — Xuất dữ liệu node ở định dạng JSON thu gọn.
|
|
66
|
+
- `toSelection(): void` — Chọn node và tập trung khung nhìn vào nó.
|
|
67
|
+
- `toPageAndSelection(): Promise<void>` — Chuyển đến trang của node và chọn nó.
|
|
68
|
+
|
|
69
|
+
## Các kiểu dữ liệu
|
|
70
|
+
|
|
71
|
+
#### `UiFigmaFramesItem`
|
|
72
|
+
Thông tin đơn giản hóa về một phần tử để hiển thị trong giao diện.
|
|
73
|
+
- `name: string` — Tên của phần tử trong Figma.
|
|
74
|
+
- `id: string` — Định danh duy nhất của node.
|
|
75
|
+
- `image?: Uint8Array | string` — Ảnh chụp màn hình của phần tử (dữ liệu nhị phân hoặc base64).
|
|
76
|
+
|
|
77
|
+
#### `UiFigmaFrameStylesItem`
|
|
78
|
+
Thông tin mở rộng về một phần tử, bao gồm style của nó. Kế thừa tất cả các trường từ `UiFigmaFramesItem`.
|
|
79
|
+
- `json?: UiFigmaFrameStylesData` — Cấu trúc dữ liệu node và style dưới định dạng JSON.
|
|
80
|
+
- `text?: string` — Nội dung văn bản (nếu node là một node văn bản).
|
|
81
|
+
- `styles?: Record<string, string>` — Một đối tượng chứa các thuộc tính CSS của chính phần tử đó.
|
|
82
|
+
- `childrenStyles?: Record<string, Record<string, string>>` — Bản đồ các style CSS cho tất cả các phần tử con, được lập chỉ mục theo ID của chúng.
|
|
83
|
+
|
|
84
|
+
#### `UiFigmaFrameStylesData`
|
|
85
|
+
- `document: UiFigmaFrameStylesJson` — Cây node dưới định dạng nén.
|
|
86
|
+
- `styles: Record<string, any>` — Một từ điển các định nghĩa style của tài liệu.
|
|
87
|
+
|
|
88
|
+
#### `UiFigmaFrameStylesJson`
|
|
89
|
+
Biểu diễn thu gọn của một node Figma để xuất JSON.
|
|
90
|
+
- `id: string` — Định danh duy nhất của node.
|
|
91
|
+
- `name: string` — Tên node.
|
|
92
|
+
- `type: string` — Kiểu node.
|
|
93
|
+
- `characters?: string` — Văn bản (cho text node).
|
|
94
|
+
- `children?: UiFigmaFrameStylesJson[]` — Danh sách các phần tử con đệ quy.
|
|
95
|
+
- `style?: Record<string, any>` — Các tham số ngoại hình.
|
|
96
|
+
- `styles?: Record<string, any>` — Các style liên quan.
|
package/src/media/functional/figma-code/classes/FigmaPluginMessenger/FigmaPluginMessenger.en.mdx
CHANGED
|
@@ -1,63 +1,33 @@
|
|
|
1
|
-
import {Meta} from '@storybook/addon-docs/blocks'
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title='@dxtmisha/en/figma-code/Classes/FigmaPluginMessenger - Backend
|
|
3
|
+
<Meta title='@dxtmisha/en/figma-code/Classes/FigmaPluginMessenger - Plugin messenger (Backend)'/>
|
|
4
4
|
|
|
5
|
-
# FigmaPluginMessenger
|
|
5
|
+
# Class `FigmaPluginMessenger`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A specialized messenger for the Figma plugin backend. It extends `FigmaPostAbstract` to provide a robust communication layer between the plugin's main logic (code side) and its user interface (UI).
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
- **Singleton Architecture** — Use `getInstance()` to ensure all parts of the plugin use the same communication hub.
|
|
12
|
+
- **Simplified API** — Wraps standard `figma.ui.postMessage` and `figma.ui.onmessage` into a more manageable interface.
|
|
13
|
+
- **Type Safety** — Supports generic types for messages to ensure data consistency.
|
|
8
14
|
|
|
9
15
|
## Initialization
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Access the singleton instance using the static `getInstance()` method.
|
|
12
18
|
|
|
13
19
|
```typescript
|
|
14
20
|
import { FigmaPluginMessenger } from '@dxtmisha/figma-code'
|
|
15
21
|
|
|
16
|
-
const messenger =
|
|
17
|
-
.make()
|
|
18
|
-
.add('hello-ui', (msg) => console.log('UI:', msg))
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Public Methods
|
|
22
|
-
|
|
23
|
-
### `make`
|
|
24
|
-
|
|
25
|
-
Initializes the message listener using the `figma.ui.onmessage` API. Should be called once to start receiving messages from the UI.
|
|
26
|
-
|
|
27
|
-
**Returns:** `this`
|
|
28
|
-
|
|
29
|
-
```javascript
|
|
30
|
-
messenger.make()
|
|
22
|
+
const messenger = FigmaPluginMessenger.getInstance()
|
|
31
23
|
```
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
## Methods
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
### Communication
|
|
36
28
|
|
|
37
|
-
|
|
38
|
-
- `type: string` — Unique identifier for the message type to listen for.
|
|
39
|
-
- `callback: (message: Message) => void` — function to execute when a matching message arrives.
|
|
29
|
+
Methods for sending and receiving messages.
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
messenger.add('resize-ui', (data) => {
|
|
45
|
-
figma.ui.resize(data.width, data.height)
|
|
46
|
-
})
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### `post`
|
|
50
|
-
|
|
51
|
-
Sends a message to the Figma UI side.
|
|
52
|
-
|
|
53
|
-
**Parameters:**
|
|
54
|
-
- `type: string` — The identifier of the message (type).
|
|
55
|
-
- `message: Message` — (Optional) Data payload to send to the UI.
|
|
56
|
-
|
|
57
|
-
**Returns:** `void`
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
messenger.post('selection-data', {
|
|
61
|
-
ids: figma.currentPage.selection.map(node => node.id)
|
|
62
|
-
})
|
|
63
|
-
```
|
|
31
|
+
- `post<Message>(type: string, message?: Message): void` — Sends a message of a specific type to the Figma UI.
|
|
32
|
+
- `add(type: string, callback: (data: any) => void): this` — (Inherited) Registers a listener for messages from the UI.
|
|
33
|
+
- `remove(type: string): this` — (Inherited) Removes a listener.
|