Skip to content

Commit fad8c47

Browse files
authored
Improve tracking of applied plugin data (#268)
1 parent d8d419e commit fad8c47

20 files changed

+638
-329
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Improve tracking of applied plugin data",
4+
"packageName": "@adaptive-web/adaptive-ui-designer-core",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Improve tracking of applied plugin data",
4+
"packageName": "@adaptive-web/adaptive-ui-designer-figma",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/adaptive-ui-designer-core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"homepage": "https://github.com/adaptive-web-community/adaptive-web-components#readme",
3434
"dependencies": {
3535
"@adaptive-web/adaptive-ui": "^0.12.0",
36-
"@microsoft/fast-foundation": "^3.0.0-alpha.31"
36+
"@microsoft/fast-foundation": "^3.0.0-alpha.31",
37+
"@types/culori": "^2.0.0"
3738
},
3839
"devDependencies": {
3940
"rimraf": "^3.0.2",

packages/adaptive-ui-designer-core/src/controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ export abstract class Controller {
2727

2828
/**
2929
* Gets a Node from the design tool by ID.
30-
* @param id The ID of the node.
30+
* @param id - The ID of the node.
3131
* @returns The PluginNode or null if no node by the provided ID exists.
3232
*/
3333
public abstract getNode(id: string): Promise<PluginNode | null>;
3434

3535
/**
3636
* Provides the state object to the UI component and updates the UI.
37-
* @param state The UI state object.
37+
* @param state - The UI state object.
3838
*/
3939
protected abstract sendStateToUI(state: PluginUIState): void;
4040

4141
/**
4242
* Sets the selected node IDs - Setting the IDs will trigger a UI refresh.
43-
* @param ids The node IDs.
43+
* @param ids - The node IDs.
4444
*/
4545
public async setSelectedNodes(ids: string[]): Promise<void> {
4646
Controller.nodeCount = 0;
@@ -60,7 +60,7 @@ export abstract class Controller {
6060

6161
/**
6262
* Handle the updated state that's posted from the UI.
63-
* @param state The state from the UI.
63+
* @param state - The state from the UI.
6464
*/
6565
public async receiveStateFromUI(state: PluginUIState): Promise<void> {
6666
// console.log("--------------------------------");

packages/adaptive-ui-designer-core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export {
1414
DesignTokenValues
1515
} from "./model.js";
1616
export { mapReplacer, mapReviver, deserializeMap, serializeMap } from "./serialization.js";
17-
export { State, StatesState, PluginNode, focusIndicatorNodeName, } from "./node.js";
17+
export { State, StatesState, PluginNode, PluginNodeDataAccessor, focusIndicatorNodeName, } from "./node.js";
1818
export { AdaptiveDesignToken, AdaptiveDesignTokenOrGroup, DesignTokenRegistry } from "./registry/design-token-registry.js";
1919
export { registerAppliableTokens, registerTokens } from "./registry/recipes.js";

packages/adaptive-ui-designer-core/src/model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class DesignTokenValue {
6464
* A token + value pair from an applied design token.
6565
*/
6666
export class AppliedDesignToken {
67-
constructor(public tokenID: string, public value: string) {
67+
constructor(public tokenID: string) {
6868
}
6969
}
7070

@@ -89,12 +89,12 @@ export type ReadonlyDesignTokenValues = ReadonlyMap<string, DesignTokenValue>;
8989
/**
9090
* Array of style modules applied to the style of a node.
9191
*/
92-
export class AppliedStyleModules extends Array<string> {}
92+
export class AppliedStyleModules extends Array<string> {} // TODO This is more accurate as a Set
9393

9494
/**
9595
* Readonly Array of style modules applied to the style of a node.
9696
*/
97-
export type ReadonlyAppliedStyleModules = ReadonlyArray<string>;
97+
export type ReadonlyAppliedStyleModules = ReadonlyArray<string>; // TODO This is more accurate as a Set
9898

9999
/**
100100
* Map of design tokens applied to the style of a node. The key is the target style property.

0 commit comments

Comments
 (0)