Consolidate Lit repositories: figma-to-lit, figma_lit_example, lit-3d-piano, lit-calculator, lit-code-editor, lit-draggable-dom, lit-file-based-routing, lit-force-graph, lit-html-editor, lit-html-table, lit-modules, lit-native, lit-node-editor, lit-sheet-music, lit-starter-ts, lit-vscode-extension, lit-wmr, vite-lit-capacitor, vite-lit-element-starter, vite-rxdb-lit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Node
|
||||
*.log
|
||||
*.log.*
|
||||
node_modules
|
||||
|
||||
out/
|
||||
dist/
|
||||
code.js
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,5 @@
|
||||
# Figma to Lit
|
||||
|
||||
This is a example plugin for Figma DevMode that exports a component to Lit Web Components.
|
||||
|
||||
There is an option to export single or multiple components.
|
||||
@@ -0,0 +1,461 @@
|
||||
import { camelCase, paramCase, pascalCase, snakeCase } from "change-case";
|
||||
// @ts-ignore
|
||||
import Mustache from 'mustache';
|
||||
|
||||
figma.codegen.on("generate", async (event) => {
|
||||
const args = await createTemplate(event.node);
|
||||
return [
|
||||
{
|
||||
language: "TYPESCRIPT",
|
||||
code: renderTemplate(args, true),
|
||||
title: "Lit (TS)",
|
||||
},
|
||||
{
|
||||
language: "JAVASCRIPT",
|
||||
code: renderTemplate(args, false),
|
||||
title: "Lit (JS)",
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
const names = new Map<string, SceneNode | Variable>();
|
||||
|
||||
function uniqueName(node: SceneNode | Variable) {
|
||||
for (const [key, value] of names) {
|
||||
if (value.id === node.id) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
function getName() {
|
||||
let target = node.name;
|
||||
if (target.includes('#')) {
|
||||
target = target.split('#')[0];
|
||||
}
|
||||
return pascalCase(target);
|
||||
}
|
||||
let target = getName();
|
||||
let count = 0;
|
||||
while (true) {
|
||||
if (!names.has(target)) {
|
||||
names.set(target, node);
|
||||
break;
|
||||
}
|
||||
target = `${getName()}${++count}`;
|
||||
}
|
||||
console.log(node, target);
|
||||
return target;
|
||||
}
|
||||
|
||||
function normalize(str: string) {
|
||||
const regex = /[^\w\s\d]/g;
|
||||
return str.replace(regex, '');
|
||||
}
|
||||
|
||||
function className(str: string) {
|
||||
// Convert raw name to PascalCase
|
||||
let result = normalize(str);
|
||||
if (/^\d/.test(str)) {
|
||||
result = `X ${result}`;
|
||||
}
|
||||
if (!result.endsWith("Element")) {
|
||||
result += " Element";
|
||||
}
|
||||
return pascalCase(result);
|
||||
}
|
||||
|
||||
function tagName(str: string) {
|
||||
// Convert raw name to kebab-case
|
||||
let result = normalize(str.trim());
|
||||
if (/^\d/.test(str)) {
|
||||
result = `x-${result}`;
|
||||
}
|
||||
result = paramCase(result);
|
||||
if (!result.endsWith("-element")) {
|
||||
result += "-element";
|
||||
}
|
||||
return paramCase(result);
|
||||
}
|
||||
|
||||
function propertyName(str: string) {
|
||||
let result = normalize(str);
|
||||
if (/^\d/.test(str)) {
|
||||
result = `x-${result}`;
|
||||
}
|
||||
return camelCase(result);
|
||||
}
|
||||
|
||||
const litTSTemplate = `
|
||||
import {html, css, LitElement} from 'lit';
|
||||
import {customElement, property} from 'lit/decorators.js';
|
||||
|
||||
{{#components}}
|
||||
@customElement('{{tag}}')
|
||||
export class {{name}} extends LitElement {
|
||||
static styles = css\`
|
||||
{{#styles}}
|
||||
.{{selector}} {
|
||||
{{#attributes}}
|
||||
{{key}}: {{value}};
|
||||
{{/attributes}}
|
||||
}
|
||||
{{/styles}}
|
||||
\`;
|
||||
|
||||
{{#properties}}
|
||||
@property({type: {{type}}}) {{name}} = {{value}};
|
||||
{{/properties}}
|
||||
|
||||
{{#events}}
|
||||
{{name}}(e: {{type}}) {
|
||||
console.log('{{name}} {{type}}', e);
|
||||
}
|
||||
{{/events}}
|
||||
|
||||
render() {
|
||||
return html\`
|
||||
{{#xml}}{{node}}{{/xml}}
|
||||
\`;
|
||||
}
|
||||
}
|
||||
|
||||
{{/components}}
|
||||
`.trim();
|
||||
|
||||
const litJSTemplate = `
|
||||
import {html, css, LitElement} from 'lit';
|
||||
|
||||
{{#components}}
|
||||
export class {{name}} extends LitElement {
|
||||
static styles = css\`
|
||||
{{#styles}}
|
||||
.{{selector}} {
|
||||
{{#attributes}}
|
||||
{{key}}: {{value}};
|
||||
{{/attributes}}
|
||||
}
|
||||
{{/styles}}
|
||||
\`;
|
||||
|
||||
static properties = {
|
||||
{{#properties}}
|
||||
{{name}}: {type: {{type}}},
|
||||
{{/properties}}
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
{{#properties}}
|
||||
this.{{name}} = {{value}};
|
||||
{{/properties}}
|
||||
}
|
||||
|
||||
{{#events}}
|
||||
{{name}}(e: {{type}}) {
|
||||
console.log('{{name}} {{type}}', e);
|
||||
}
|
||||
{{/events}}
|
||||
|
||||
render() {
|
||||
return html\`
|
||||
{{#xml}}{{node}}{{/xml}}
|
||||
\`;
|
||||
}
|
||||
}
|
||||
customElements.define('{{tag}}', {{name}});
|
||||
{{/components}}
|
||||
`.trim();
|
||||
|
||||
interface LitTemplate {
|
||||
components: LitComponent[];
|
||||
}
|
||||
|
||||
interface LitComponent {
|
||||
tag: string;
|
||||
name: string;
|
||||
styles: LitStyle[];
|
||||
properties: LitProperty[];
|
||||
events: LitEvent[];
|
||||
node: LitNode;
|
||||
}
|
||||
|
||||
interface LitStyle {
|
||||
selector: string;
|
||||
attributes: LitStyleAttribute[];
|
||||
}
|
||||
|
||||
interface LitStyleAttribute {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface LitEvent {
|
||||
type: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface LitProperty {
|
||||
type: string;
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface LitNode {
|
||||
tag: string;
|
||||
attributes: LitStyleAttribute[] | null;
|
||||
children: LitNode[] | string[] | null;
|
||||
component: boolean;
|
||||
node: SceneNode,
|
||||
}
|
||||
|
||||
async function createTemplate(node: SceneNode): Promise<LitTemplate> {
|
||||
const components: LitComponent[] = [];
|
||||
|
||||
async function addComponent(target: SceneNode) {
|
||||
// const globalAttrs = getNodeProperties(target, { recursive: true });
|
||||
if (isComponent(target) || target === node) {
|
||||
const styles: LitStyle[] = [];
|
||||
const events: LitEvent[] = [];
|
||||
const properties: LitProperty[] = [];
|
||||
|
||||
async function addStyle(child: SceneNode) {
|
||||
if (isComponent(child) && target !== child) return;
|
||||
|
||||
const css = await child.getCSSAsync();
|
||||
styles.push({
|
||||
selector: tagName(uniqueName(child)),
|
||||
attributes: Object.entries(css).map((([key, value]) => ({ key, value })))
|
||||
});
|
||||
|
||||
if ('children' in child) {
|
||||
for (const item of child.children) {
|
||||
await addStyle(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await addStyle(target);
|
||||
|
||||
const attrs = getNodeProperties(target, { recursive: true });
|
||||
for (const [key, value] of Object.entries({ ...attrs })) {
|
||||
properties.push({
|
||||
type: 'String',
|
||||
name: propertyName(key),
|
||||
value: typeof value === 'string' ? `'${value}'` : value,
|
||||
});
|
||||
}
|
||||
|
||||
function addEvents(child: SceneNode) {
|
||||
if ('reactions' in child) {
|
||||
const reactions = child.reactions;
|
||||
for (const item of reactions) {
|
||||
if (item.trigger) {
|
||||
const type = item.trigger.type;
|
||||
if (type === 'ON_CLICK') {
|
||||
const eventName = propertyName(`${snakeCase(uniqueName(child))}-${type}`);
|
||||
events.push({
|
||||
name: eventName,
|
||||
type: 'Event',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ('children' in child) {
|
||||
for (const item of child.children) {
|
||||
if (!isComponent(item)) {
|
||||
addEvents(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addEvents(target);
|
||||
|
||||
const component: LitComponent = {
|
||||
node: nodeTree(target),
|
||||
name: className(uniqueName(target)),
|
||||
tag: tagName(uniqueName(target)),
|
||||
styles,
|
||||
events,
|
||||
properties,
|
||||
};
|
||||
components.push(component);
|
||||
|
||||
if ('children' in target) {
|
||||
for (const child of target.children) {
|
||||
await addComponent(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await addComponent(node);
|
||||
|
||||
return { components };
|
||||
}
|
||||
|
||||
function renderXml(node: LitNode) {
|
||||
const sb: string[] = [];
|
||||
if (node.component) {
|
||||
if (node.attributes) {
|
||||
sb.push(`<${node.tag} `)
|
||||
for (const attr of node.attributes) {
|
||||
sb.push(` ${propertyName(attr.key)}=\${this.${propertyName(attr.key)}} `)
|
||||
}
|
||||
sb.push(`>`)
|
||||
} else {
|
||||
sb.push(`<${node.tag}>`)
|
||||
}
|
||||
sb.push(`</${node.tag}>`)
|
||||
} else {
|
||||
let events = false;
|
||||
let element = 'div';
|
||||
if ('reactions' in node.node) {
|
||||
const reactions = node.node.reactions;
|
||||
events = reactions.length > 0;
|
||||
for (const item of reactions) {
|
||||
if (item.trigger) {
|
||||
if (
|
||||
item.trigger.type === "ON_CLICK" ||
|
||||
item.trigger.type === "ON_HOVER" ||
|
||||
item.trigger.type === "ON_PRESS" ||
|
||||
item.trigger.type === "MOUSE_DOWN"
|
||||
) {
|
||||
element = 'button';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (events) {
|
||||
sb.push(`<${element} class="${node.tag}"`)
|
||||
if ('reactions' in node.node) {
|
||||
const reactions = node.node.reactions;
|
||||
for (const item of reactions) {
|
||||
if (item.trigger) {
|
||||
const type = item.trigger.type;
|
||||
if (type === 'ON_CLICK') {
|
||||
const eventName = propertyName(`${snakeCase(uniqueName(node.node))}-${type}`);
|
||||
sb.push(` @click=\${this.${eventName}}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.push(`>`)
|
||||
} else {
|
||||
sb.push(`<${element} class="${node.tag}">`)
|
||||
}
|
||||
if (node.children) {
|
||||
for (const child of node.children) {
|
||||
if (typeof child === 'string') {
|
||||
let bound = false;
|
||||
if (node.node.boundVariables?.characters) {
|
||||
const variable = figma.variables.getVariableById(node.node.boundVariables.characters.id);
|
||||
if (variable) {
|
||||
sb.push(` \${this.${propertyName(uniqueName(variable))}}`);
|
||||
bound = true;
|
||||
}
|
||||
} else if (node.node.componentPropertyReferences?.characters) {
|
||||
const label = node.node.componentPropertyReferences.characters.split('#')[0];
|
||||
sb.push(` \${this.${propertyName(label)}}`);
|
||||
bound = true;
|
||||
}
|
||||
if (!bound) sb.push(` ${child}`);
|
||||
} else {
|
||||
sb.push(` ${renderXml(child)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.push(`</${element}>`)
|
||||
}
|
||||
return sb.join('\n');
|
||||
}
|
||||
|
||||
function renderTemplate(args: LitTemplate, typescript: boolean = true) {
|
||||
const template = typescript ? litTSTemplate : litJSTemplate;
|
||||
Mustache.escape = function (text: string) { return text; };
|
||||
return Mustache.render(template, {
|
||||
...args,
|
||||
"xml": function () {
|
||||
return () => renderXml(this.node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getNodeProperties(node: SceneNode, options?: {
|
||||
recursive?: boolean
|
||||
}) {
|
||||
const attributes: { [key: string]: string } = {};
|
||||
|
||||
if (node.type === 'COMPONENT') {
|
||||
const properties = node.componentPropertyDefinitions;
|
||||
for (const [key, value] of Object.entries(properties)) {
|
||||
const label = key.split('#')[0];
|
||||
attributes[label] = `${value.defaultValue}`;
|
||||
}
|
||||
}
|
||||
if (node.type === 'INSTANCE') {
|
||||
const properties = node.componentProperties;
|
||||
for (const [key, value] of Object.entries(properties)) {
|
||||
const label = key.split('#')[0];
|
||||
attributes[label] = `${value.value}`;
|
||||
}
|
||||
}
|
||||
if (node.boundVariables) {
|
||||
const variables = node.boundVariables!
|
||||
if (variables?.characters) {
|
||||
const variable = figma.variables.getVariableById(variables.characters.id);
|
||||
if (variable) {
|
||||
attributes[uniqueName(variable)] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const references = node.componentPropertyReferences;
|
||||
if (references?.characters) {
|
||||
const label = references.characters.split('#')[0];
|
||||
attributes[label] = attributes[label] ?? label;
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
if ('children' in node) {
|
||||
for (const child of node.children) {
|
||||
const attrs = getNodeProperties(child, { recursive: true });
|
||||
for (const [key, value] of Object.entries(attrs)) {
|
||||
attributes[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
function nodeTree(node: SceneNode, root: boolean = true): LitNode {
|
||||
const children: LitNode[] = [];
|
||||
const attributes = getNodeProperties(node, { recursive: true });
|
||||
if ('children' in node) {
|
||||
for (const child of node.children) {
|
||||
children.push(nodeTree(child, false));
|
||||
}
|
||||
}
|
||||
const attrs = Object.entries(attributes).map(([key, value]) => ({ key, value }));
|
||||
let str: string | null = null;
|
||||
if ('characters' in node) {
|
||||
str = node.characters;
|
||||
}
|
||||
return {
|
||||
node,
|
||||
tag: tagName(uniqueName(node)),
|
||||
children: children.length === 0 ? (str ? [str] : null) : children,
|
||||
attributes: attrs.length === 0 ? null : attrs,
|
||||
component: isComponent(node) && !root,
|
||||
};
|
||||
}
|
||||
|
||||
function isComponent(node: SceneNode) {
|
||||
return (
|
||||
node.type === "COMPONENT" ||
|
||||
node.type === "INSTANCE" ||
|
||||
node.type === 'FRAME'
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "Figma to Lit",
|
||||
"id": "1253959744483104113",
|
||||
"api": "1.0.0",
|
||||
"main": "code.js",
|
||||
"capabilities": [
|
||||
"codegen"
|
||||
],
|
||||
"enableProposedApi": false,
|
||||
"editorType": [
|
||||
"dev"
|
||||
],
|
||||
"ui": "ui.html",
|
||||
"codegenPreferences": [
|
||||
{
|
||||
"itemType": "select",
|
||||
"propertyName": "outputType",
|
||||
"label": "Output Type",
|
||||
"options": [
|
||||
{
|
||||
"label": "Single Web Component",
|
||||
"value": "single", "isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Separate Web Components",
|
||||
"value": "multi"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"codegenLanguages": [
|
||||
{
|
||||
"label": "Lit",
|
||||
"value": "typescript"
|
||||
}
|
||||
],
|
||||
"networkAccess": {
|
||||
"allowedDomains": [
|
||||
"none"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "figma-lit-exporter",
|
||||
"version": "1.0.0",
|
||||
"description": "Lit (Web Component) export for Figma",
|
||||
"main": "code.js",
|
||||
"scripts": {
|
||||
"build": "esbuild code.ts --bundle --outfile=code.js --target=ES6",
|
||||
"watch": "esbuild code.ts --bundle --outfile=code.js --target=ES6 --watch"
|
||||
},
|
||||
"author": "",
|
||||
"license": "",
|
||||
"devDependencies": {
|
||||
"@figma/plugin-typings": "*",
|
||||
"@types/mustache": "^4.2.2",
|
||||
"esbuild": "^0.18.7",
|
||||
"typescript": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"change-case": "^4.1.2",
|
||||
"js-beautify": "^1.14.8",
|
||||
"mustache": "^4.2.0",
|
||||
"xml-formatter": "^3.4.1"
|
||||
}
|
||||
}
|
||||
Generated
+532
@@ -0,0 +1,532 @@
|
||||
lockfileVersion: 5.4
|
||||
|
||||
specifiers:
|
||||
'@figma/plugin-typings': '*'
|
||||
'@types/mustache': ^4.2.2
|
||||
change-case: ^4.1.2
|
||||
esbuild: ^0.18.7
|
||||
js-beautify: ^1.14.8
|
||||
mustache: ^4.2.0
|
||||
typescript: '*'
|
||||
xml-formatter: ^3.4.1
|
||||
|
||||
dependencies:
|
||||
change-case: 4.1.2
|
||||
js-beautify: 1.14.8
|
||||
mustache: 4.2.0
|
||||
xml-formatter: 3.4.1
|
||||
|
||||
devDependencies:
|
||||
'@figma/plugin-typings': 1.68.0
|
||||
'@types/mustache': 4.2.2
|
||||
esbuild: 0.18.9
|
||||
typescript: 5.1.3
|
||||
|
||||
packages:
|
||||
|
||||
/@esbuild/android-arm/0.18.9:
|
||||
resolution: {integrity: sha512-v1cr0l0RZOzIgLtTe8M1cRFFP0ICRdymPPa8HCPUpgZ+XasQrd5Mxyp9KlDqXLLyGmnZpzhufKEThLIihQL53A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm64/0.18.9:
|
||||
resolution: {integrity: sha512-G1rIBpSgjv0DEFmBYjljL85l4asf1dtQYwjoD02A5YG85JV3dsQSJL94vsEMWYMWkNd46hcvz3suURuY4dr+9g==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-x64/0.18.9:
|
||||
resolution: {integrity: sha512-rPgcISGfoP7/Yk8+0eUf9R/KLCYGgqtojz/Uvj26wp7/EclwxoaOMArBnDChfuWF5YLdS16dDfqb4qwXS087lw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-arm64/0.18.9:
|
||||
resolution: {integrity: sha512-vw9kWBT2EvDhLAVkI5c2KWFh+GMwgXrzR1QnIpZazA+tIacaelNLMMSTHEJisOeQqiMQhv8goTODFm9liS7wpw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-x64/0.18.9:
|
||||
resolution: {integrity: sha512-tDbKKMUeS0PckRtIxdF3+NgkE19kTyLFmUQ0umgXDnBvcWC3/DqhZyu4P4Af3zBzOfWH5DAAmGW1hgy53Z706w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-arm64/0.18.9:
|
||||
resolution: {integrity: sha512-Anyk3qeTKJUcxiLE8VQ6y6frVuqFc71M5TEc2EzvXchoy6oWn5eZK+MpZBVnENVMSDA4wOjDKiFsPtVhnrhHHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-x64/0.18.9:
|
||||
resolution: {integrity: sha512-BsOYio/4p/6RWG+sDQXVYet8qQ0bB91rfO0YNk5s0HlqE9vEth3Yi1jFNi4v7bUA4vQDWWoybpA/9NTz1sM88A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm/0.18.9:
|
||||
resolution: {integrity: sha512-YotJBEt9swVrEBRBIXQzI03A4kDQSWk+mbGTTBreIRvWWWTXXqhNYZgqiwnEvtyQi9aqSipEzkRzAGNqs54EXw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm64/0.18.9:
|
||||
resolution: {integrity: sha512-2fJtf4KKR301FrhRNY1KIgVid2nUrZV6fzx39E+JgT3jAw2NsZYUiphR31CyH4MloyoEwgQTnskwaQH+nT4bHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ia32/0.18.9:
|
||||
resolution: {integrity: sha512-pTTBAGi2lrduXo4vATnqCtFi9zRbyXOlcV+euznW5EoFyjAIR+JCQgFDeFCMo343E2EI2MgV7ZQctO8IWcsdsA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64/0.18.9:
|
||||
resolution: {integrity: sha512-hmsjvhwHrsCKPthXhhNjLE+QON8uQCE9P/OBktaYOD8UDfmz9+txm04uXhnkRH0fDEqStsDEedbX+8KPg1CwyA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-mips64el/0.18.9:
|
||||
resolution: {integrity: sha512-Ymv4j25ie7mVEVlcThnOlRVvqDSsj22MJBH31QGMsyA0dUwReqCg9yNqRM2Dh8QHDRO2UrMhGmiL6BaTdBWlQw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ppc64/0.18.9:
|
||||
resolution: {integrity: sha512-y2viEHwLpNfWP1eLa+vV+DWIbw/pQyv1Vf6qxSGJeBQmmu9T2hOagMiCr6zhDo89l+MUAXiShdKmqlKI6HdCkw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-riscv64/0.18.9:
|
||||
resolution: {integrity: sha512-na8WG8Z7z1EIUcJFuXKOawJEsq8luOur7LHK/ophO0+RSE8A9yxCsKYhaN9IxlR1UciAuHjo/7d5yiflABwUmA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-s390x/0.18.9:
|
||||
resolution: {integrity: sha512-XsnaI89KstE0jG4cMdzuJ8SKcKAod26had7U/4SzvuMrci0/XyEQXB1jikn6MB7LPGrd5rcLeYp3F7psUxhkWw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-x64/0.18.9:
|
||||
resolution: {integrity: sha512-odEbmjtm3tLPtY43FRWOG+CLN7d4ooQpGjYVFVti5rLXLym26dORxnlbekNPXuQRuQKNMPczNNWE1jOc8yAyJQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/netbsd-x64/0.18.9:
|
||||
resolution: {integrity: sha512-j/GgOjKNUPd54isC/RBYlS6CREbulnMWAJEIKTnPM0QnY0pEGfMHkFh73bsmZdovp/97zRty0NdePRk4dTP/cw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/openbsd-x64/0.18.9:
|
||||
resolution: {integrity: sha512-DN0Z9RGU/hlaMWSG9GaDLvlu0718u1HDGiF19wJ35fUznf9yJYgXDwZ5/cRQXUewHXJB0pD/VyQfRLDP3M4maw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/sunos-x64/0.18.9:
|
||||
resolution: {integrity: sha512-W/eHabLCXdki/8H3jmfE/ClDuh3bQQKpYfQHGQ7lQync9W72ZdVr2y1iWfEVTE7ZK/DQROo3GyfTkx5HPBZxmQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-arm64/0.18.9:
|
||||
resolution: {integrity: sha512-84FMz3Sh1hwGk/oWy6XGIW2bGVcsqvHLjjtbwd982XoTHOvQSthhrMef0J+4ShE1ZE7VeUXHIt2Mfer+myedYw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-ia32/0.18.9:
|
||||
resolution: {integrity: sha512-/RsFTk0P13Nb+ixBVZfPdlLWKsP+he3ZLxOO/1eCsZZ2U7c/JxB053U7kURsyhhUPwiGzGVaAQAeyhGtYe8ehw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-x64/0.18.9:
|
||||
resolution: {integrity: sha512-S+oBiO8UE1hmDJZlZJ6HZEdBBrxCGovwN66P9rle4DWVktM5fsMouYhpbtUf4WQLEy0HvcE2ZOQ2gIq8v0BkBw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@figma/plugin-typings/1.68.0:
|
||||
resolution: {integrity: sha512-hT+iqf5CRRqKI7NmPdwml+Ld/mG1QM8VcZZURV2AowIy6vC3VQ2iIIT5d7ulDnQU+WzQDvaGaDAw/J5X6tQ2Ww==}
|
||||
dev: true
|
||||
|
||||
/@types/mustache/4.2.2:
|
||||
resolution: {integrity: sha512-MUSpfpW0yZbTgjekDbH0shMYBUD+X/uJJJMm9LXN1d5yjl5lCY1vN/eWKD6D1tOtjA6206K0zcIPnUaFMurdNA==}
|
||||
dev: true
|
||||
|
||||
/abbrev/1.1.1:
|
||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
||||
dev: false
|
||||
|
||||
/balanced-match/1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
dev: false
|
||||
|
||||
/brace-expansion/2.0.1:
|
||||
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
dev: false
|
||||
|
||||
/camel-case/4.1.2:
|
||||
resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}
|
||||
dependencies:
|
||||
pascal-case: 3.1.2
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/capital-case/1.0.4:
|
||||
resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
upper-case-first: 2.0.2
|
||||
dev: false
|
||||
|
||||
/change-case/4.1.2:
|
||||
resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==}
|
||||
dependencies:
|
||||
camel-case: 4.1.2
|
||||
capital-case: 1.0.4
|
||||
constant-case: 3.0.4
|
||||
dot-case: 3.0.4
|
||||
header-case: 2.0.4
|
||||
no-case: 3.0.4
|
||||
param-case: 3.0.4
|
||||
pascal-case: 3.1.2
|
||||
path-case: 3.0.4
|
||||
sentence-case: 3.0.4
|
||||
snake-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/commander/2.20.3:
|
||||
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
||||
dev: false
|
||||
|
||||
/config-chain/1.1.13:
|
||||
resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==}
|
||||
dependencies:
|
||||
ini: 1.3.8
|
||||
proto-list: 1.2.4
|
||||
dev: false
|
||||
|
||||
/constant-case/3.0.4:
|
||||
resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
upper-case: 2.0.2
|
||||
dev: false
|
||||
|
||||
/dot-case/3.0.4:
|
||||
resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/editorconfig/0.15.3:
|
||||
resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
commander: 2.20.3
|
||||
lru-cache: 4.1.5
|
||||
semver: 5.7.1
|
||||
sigmund: 1.0.1
|
||||
dev: false
|
||||
|
||||
/esbuild/0.18.9:
|
||||
resolution: {integrity: sha512-rFw+7KsO3vF/imkldsCcIGnQVJ11Zq5a178SVS0N0wwFQ/alzS8owG06rivQ8FEuc66SJupdhTuYT7mnvmidLA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/android-arm': 0.18.9
|
||||
'@esbuild/android-arm64': 0.18.9
|
||||
'@esbuild/android-x64': 0.18.9
|
||||
'@esbuild/darwin-arm64': 0.18.9
|
||||
'@esbuild/darwin-x64': 0.18.9
|
||||
'@esbuild/freebsd-arm64': 0.18.9
|
||||
'@esbuild/freebsd-x64': 0.18.9
|
||||
'@esbuild/linux-arm': 0.18.9
|
||||
'@esbuild/linux-arm64': 0.18.9
|
||||
'@esbuild/linux-ia32': 0.18.9
|
||||
'@esbuild/linux-loong64': 0.18.9
|
||||
'@esbuild/linux-mips64el': 0.18.9
|
||||
'@esbuild/linux-ppc64': 0.18.9
|
||||
'@esbuild/linux-riscv64': 0.18.9
|
||||
'@esbuild/linux-s390x': 0.18.9
|
||||
'@esbuild/linux-x64': 0.18.9
|
||||
'@esbuild/netbsd-x64': 0.18.9
|
||||
'@esbuild/openbsd-x64': 0.18.9
|
||||
'@esbuild/sunos-x64': 0.18.9
|
||||
'@esbuild/win32-arm64': 0.18.9
|
||||
'@esbuild/win32-ia32': 0.18.9
|
||||
'@esbuild/win32-x64': 0.18.9
|
||||
dev: true
|
||||
|
||||
/fs.realpath/1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
dev: false
|
||||
|
||||
/glob/8.1.0:
|
||||
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 5.1.6
|
||||
once: 1.4.0
|
||||
dev: false
|
||||
|
||||
/header-case/2.0.4:
|
||||
resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==}
|
||||
dependencies:
|
||||
capital-case: 1.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/inflight/1.0.6:
|
||||
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
wrappy: 1.0.2
|
||||
dev: false
|
||||
|
||||
/inherits/2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: false
|
||||
|
||||
/ini/1.3.8:
|
||||
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
|
||||
dev: false
|
||||
|
||||
/js-beautify/1.14.8:
|
||||
resolution: {integrity: sha512-4S7HFeI9YfRvRgKnEweohs0tgJj28InHVIj4Nl8Htf96Y6pHg3+tJrmo4ucAM9f7l4SHbFI3IvFAZ2a1eQPbyg==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
config-chain: 1.1.13
|
||||
editorconfig: 0.15.3
|
||||
glob: 8.1.0
|
||||
nopt: 6.0.0
|
||||
dev: false
|
||||
|
||||
/lower-case/2.0.2:
|
||||
resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
|
||||
dependencies:
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/lru-cache/4.1.5:
|
||||
resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
|
||||
dependencies:
|
||||
pseudomap: 1.0.2
|
||||
yallist: 2.1.2
|
||||
dev: false
|
||||
|
||||
/minimatch/5.1.6:
|
||||
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
brace-expansion: 2.0.1
|
||||
dev: false
|
||||
|
||||
/mustache/4.2.0:
|
||||
resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/no-case/3.0.4:
|
||||
resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
|
||||
dependencies:
|
||||
lower-case: 2.0.2
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/nopt/6.0.0:
|
||||
resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
abbrev: 1.1.1
|
||||
dev: false
|
||||
|
||||
/once/1.4.0:
|
||||
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
dev: false
|
||||
|
||||
/param-case/3.0.4:
|
||||
resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==}
|
||||
dependencies:
|
||||
dot-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/pascal-case/3.1.2:
|
||||
resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/path-case/3.0.4:
|
||||
resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==}
|
||||
dependencies:
|
||||
dot-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/proto-list/1.2.4:
|
||||
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
|
||||
dev: false
|
||||
|
||||
/pseudomap/1.0.2:
|
||||
resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
|
||||
dev: false
|
||||
|
||||
/semver/5.7.1:
|
||||
resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/sentence-case/3.0.4:
|
||||
resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
upper-case-first: 2.0.2
|
||||
dev: false
|
||||
|
||||
/sigmund/1.0.1:
|
||||
resolution: {integrity: sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==}
|
||||
dev: false
|
||||
|
||||
/snake-case/3.0.4:
|
||||
resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
|
||||
dependencies:
|
||||
dot-case: 3.0.4
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/tslib/2.5.3:
|
||||
resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==}
|
||||
dev: false
|
||||
|
||||
/typescript/5.1.3:
|
||||
resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/upper-case-first/2.0.2:
|
||||
resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==}
|
||||
dependencies:
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/upper-case/2.0.2:
|
||||
resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==}
|
||||
dependencies:
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/wrappy/1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
dev: false
|
||||
|
||||
/xml-formatter/3.4.1:
|
||||
resolution: {integrity: sha512-C7VwnZpz662mZlKtrdREucsABAIlmdph/nMEUszTMsRAGGPMSNfyNOU4UaPBqxXYVadb9uSpc1Xibbj6XpbGRA==}
|
||||
engines: {node: '>= 14'}
|
||||
dependencies:
|
||||
xml-parser-xo: 4.1.0
|
||||
dev: false
|
||||
|
||||
/xml-parser-xo/4.1.0:
|
||||
resolution: {integrity: sha512-9mQMLmq8J++XlQH9WF57oQxFVbR3YM6dPPtTuV+++aMe2gRoRU/kj819/6IptUmfhC1d2DSFiYxEcpkoLabeJw==}
|
||||
engines: {node: '>= 14'}
|
||||
dev: false
|
||||
|
||||
/yallist/2.1.2:
|
||||
resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==}
|
||||
dev: false
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"lib": ["es2017"],
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules/@figma"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user