@dnncommunity/dnn-elements 0.24.3 → 0.24.4-beta.11

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.
@@ -0,0 +1,20 @@
1
+ declare const plugin: {
2
+ configs: {
3
+ readonly recommended: {
4
+ plugins: {
5
+ "dnn-elements": any;
6
+ };
7
+ rules: {
8
+ "no-label-slot-in-checkbox": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("./utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
9
+ };
10
+ };
11
+ };
12
+ meta: {
13
+ name: string;
14
+ version: string;
15
+ };
16
+ rules: {
17
+ "no-label-slot-in-checkbox": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("./utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
18
+ };
19
+ };
20
+ export default plugin;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rules_1 = require("./rules");
4
+ const { name, version } =
5
+ // `import`ing here would bypass the TSConfig's `"rootDir": "src"`
6
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
7
+ require("../../package.json");
8
+ const plugin = {
9
+ configs: {
10
+ get recommended() {
11
+ return recommended;
12
+ },
13
+ },
14
+ meta: { name, version },
15
+ rules: rules_1.rules,
16
+ };
17
+ const recommended = {
18
+ plugins: {
19
+ "dnn-elements": plugin,
20
+ },
21
+ rules: rules_1.rules,
22
+ };
23
+ exports.default = plugin;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,mCAAgC;AAEhC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;AACrB,kEAAkE;AAClE,iEAAiE;AACjE,OAAO,CAAC,oBAAoB,CAAwC,CAAC;AAEvE,MAAM,MAAM,GAAG;IACX,OAAO,EAAE;QACL,IAAI,WAAW;YACX,OAAO,WAAW,CAAC;QACvB,CAAC;KACJ;IACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACvB,KAAK,EAAL,aAAK;CACR,CAAC;AAEF,MAAM,WAAW,GAAG;IAChB,OAAO,EAAE;QACL,cAAc,EAAE,MAAM;KACzB;IACD,KAAK,EAAL,aAAK;CACR,CAAC;AAEF,kBAAe,MAAM,CAAC","sourcesContent":["import { rules } from \"./rules\";\r\n\r\nconst { name, version } =\r\n // `import`ing here would bypass the TSConfig's `\"rootDir\": \"src\"`\r\n // eslint-disable-next-line @typescript-eslint/no-require-imports\r\n require(\"../../package.json\") as typeof import(\"../../package.json\");\r\n\r\nconst plugin = {\r\n configs: {\r\n get recommended() {\r\n return recommended;\r\n },\r\n },\r\n meta: { name, version },\r\n rules,\r\n};\r\n\r\nconst recommended = {\r\n plugins: {\r\n \"dnn-elements\": plugin,\r\n },\r\n rules,\r\n};\r\n\r\nexport default plugin;"]}
@@ -0,0 +1,3 @@
1
+ export declare const rules: {
2
+ "no-label-slot-in-checkbox": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ const no_label_slot_in_checkbox_1 = require("./no-label-slot-in-checkbox");
5
+ exports.rules = {
6
+ "no-label-slot-in-checkbox": no_label_slot_in_checkbox_1.rule,
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;AAAA,2EAA4E;AAE/D,QAAA,KAAK,GAAG;IACjB,2BAA2B,EAAE,gCAAqB;CACrD,CAAA","sourcesContent":["import { rule as noLabelSlotInCheckbox } from \"./no-label-slot-in-checkbox\";\r\n\r\nexport const rules = {\r\n \"no-label-slot-in-checkbox\": noLabelSlotInCheckbox,\r\n}"]}
@@ -0,0 +1 @@
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLabelSlotInCheckbox", [], import("../utils").TypedLintingRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rule = void 0;
4
+ const utils_1 = require("../utils");
5
+ exports.rule = (0, utils_1.createRule)({
6
+ name: "no-label-slot-in-checkbox",
7
+ defaultOptions: [],
8
+ meta: {
9
+ docs: {
10
+ description: "Disallow label slot in checkbox",
11
+ recommended: true,
12
+ url: "https://github.com/DNNCommunity/dnn-elements/releases/tag/v0.24.0",
13
+ },
14
+ type: "problem",
15
+ messages: {
16
+ noLabelSlotInCheckbox: "Label slot is not allowed in dnn-checkbox, wrap dnn-checkbox with a label instead."
17
+ },
18
+ fixable: "code",
19
+ schema: [], // Ensure schema is defined as an empty array or with the appropriate schema definition
20
+ },
21
+ create(context) {
22
+ return {
23
+ JSXElement(node) {
24
+ if (node.openingElement.name.type === "JSXIdentifier" &&
25
+ node.openingElement.name.name === "dnn-checkbox") {
26
+ const innerContent = node.children
27
+ .map(child => context.sourceCode.getText(child))
28
+ .join("")
29
+ .trim();
30
+ if (innerContent) {
31
+ context.report({
32
+ node,
33
+ messageId: "noLabelSlotInCheckbox",
34
+ fix: fixer => {
35
+ const checkboxText = context.sourceCode.getText(node.openingElement);
36
+ const selfClosing = checkboxText.replace(/>$/, " />");
37
+ const replacement = `<label>\n${selfClosing}\n${innerContent}\n</label>`;
38
+ return fixer.replaceText(node, replacement);
39
+ }
40
+ });
41
+ }
42
+ }
43
+ }
44
+ };
45
+ },
46
+ });
47
+ //# sourceMappingURL=no-label-slot-in-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":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OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;4BAChD,CAAC;yBACJ,CAAC,CAAC;oBACP,CAAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import { createRule } from \"../utils\";\r\n\r\nexport const rule = createRule({\r\n name: \"no-label-slot-in-checkbox\",\r\n defaultOptions: [],\r\n meta: {\r\n docs: {\r\n description: \"Disallow label slot in checkbox\",\r\n recommended: true,\r\n url: \"https://github.com/DNNCommunity/dnn-elements/releases/tag/v0.24.0\",\r\n },\r\n type: \"problem\",\r\n messages: {\r\n noLabelSlotInCheckbox: \"Label slot is not allowed in dnn-checkbox, wrap dnn-checkbox with a label instead.\"\r\n },\r\n fixable: \"code\",\r\n schema: [], // Ensure schema is defined as an empty array or with the appropriate schema definition\r\n },\r\n create(context) {\r\n return {\r\n JSXElement(node) {\r\n if (\r\n node.openingElement.name.type === \"JSXIdentifier\" &&\r\n node.openingElement.name.name === \"dnn-checkbox\"\r\n ) {\r\n const innerContent = node.children\r\n .map(child => context.sourceCode.getText(child))\r\n .join(\"\")\r\n .trim();\r\n \r\n if (innerContent) {\r\n context.report({\r\n node,\r\n messageId: \"noLabelSlotInCheckbox\",\r\n fix: fixer => {\r\n const checkboxText = context.sourceCode.getText(node.openingElement);\r\n const selfClosing = checkboxText.replace(/>$/, \" />\");\r\n \r\n const replacement = `<label>\\n${selfClosing}\\n${innerContent}\\n</label>`;\r\n return fixer.replaceText(node, replacement);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n };\r\n },\r\n});\r\n"]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rule_tester_1 = require("@typescript-eslint/rule-tester");
4
+ const no_label_slot_in_checkbox_1 = require("./no-label-slot-in-checkbox");
5
+ const ruleTester = new rule_tester_1.RuleTester();
6
+ // Define a reusable configuration for JSX parser options
7
+ const jsxParserOptions = {
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ jsx: true,
11
+ },
12
+ },
13
+ };
14
+ ruleTester.run("no-label-slot-in-checkbox", no_label_slot_in_checkbox_1.rule, {
15
+ valid: [
16
+ {
17
+ code: "<dnn-checkbox></dnn-checkbox>",
18
+ languageOptions: jsxParserOptions,
19
+ },
20
+ ],
21
+ invalid: [
22
+ {
23
+ code: "<dnn-checkbox onClick={e => console.log(e)}>Something</dnn-checkbox>",
24
+ languageOptions: jsxParserOptions,
25
+ errors: [{ messageId: "noLabelSlotInCheckbox" }],
26
+ output: "<label>\n<dnn-checkbox onClick={e => console.log(e)} />\nSomething\n</label>",
27
+ },
28
+ ],
29
+ });
30
+ //# sourceMappingURL=no-label-slot-in-checkbox.tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-label-slot-in-checkbox.tests.js","sourceRoot":"","sources":["../../src/rules/no-label-slot-in-checkbox.tests.ts"],"names":[],"mappings":";;AAAA,gEAA4D;AAC5D,2EAAmD;AAEnD,MAAM,UAAU,GAAG,IAAI,wBAAU,EAAE,CAAC;AAEpC,yDAAyD;AACzD,MAAM,gBAAgB,GAAG;IACrB,aAAa,EAAE;QACX,YAAY,EAAE;YACV,GAAG,EAAE,IAAI;SACZ;KACJ;CACJ,CAAC;AAEF,UAAU,CAAC,GAAG,CAAC,2BAA2B,EAAE,gCAAI,EAAE;IAC9C,KAAK,EAAE;QACH;YACI,IAAI,EAAE,+BAA+B;YACrC,eAAe,EAAE,gBAAgB;SACpC;KACJ;IACD,OAAO,EAAE;QACL;YACI,IAAI,EAAE,sEAAsE;YAC5E,eAAe,EAAE,gBAAgB;YACjC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;YAChD,MAAM,EAAE,8EAA8E;SACzF;KACJ;CACJ,CAAC,CAAC","sourcesContent":["import { RuleTester } from \"@typescript-eslint/rule-tester\";\r\nimport { rule } from \"./no-label-slot-in-checkbox\";\r\n\r\nconst ruleTester = new RuleTester();\r\n\r\n// Define a reusable configuration for JSX parser options\r\nconst jsxParserOptions = {\r\n parserOptions: {\r\n ecmaFeatures: {\r\n jsx: true,\r\n },\r\n },\r\n};\r\n\r\nruleTester.run(\"no-label-slot-in-checkbox\", rule, {\r\n valid: [\r\n {\r\n code: \"<dnn-checkbox></dnn-checkbox>\",\r\n languageOptions: jsxParserOptions,\r\n },\r\n ],\r\n invalid: [\r\n {\r\n code: \"<dnn-checkbox onClick={e => console.log(e)}>Something</dnn-checkbox>\",\r\n languageOptions: jsxParserOptions,\r\n errors: [{ messageId: \"noLabelSlotInCheckbox\" }],\r\n output: \"<label>\\n<dnn-checkbox onClick={e => console.log(e)} />\\nSomething\\n</label>\",\r\n },\r\n ],\r\n});"]}
@@ -0,0 +1,7 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ export interface TypedLintingRuleDocs {
3
+ description: string;
4
+ recommended?: boolean;
5
+ requiresTyepeChecking?: boolean;
6
+ }
7
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, TypedLintingRuleDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, TypedLintingRuleDocs, ESLintUtils.RuleListener>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRule = void 0;
4
+ const utils_1 = require("@typescript-eslint/utils");
5
+ ;
6
+ exports.createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/DNNCommunity/dnn-elements/tree/main/packages/stencil-library/eslint-plugin/docs/${name}.md`);
7
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAMtD,CAAC;AAEW,QAAA,UAAU,GAAG,mBAAW,CAAC,WAAW,CAC7C,IAAI,CAAC,EAAE,CAAC,sGAAsG,IAAI,KAAK,CAC1H,CAAC","sourcesContent":["import { ESLintUtils } from \"@typescript-eslint/utils\";\r\n\r\nexport interface TypedLintingRuleDocs {\r\n description: string;\r\n recommended?: boolean;\r\n requiresTyepeChecking?: boolean;\r\n};\r\n\r\nexport const createRule = ESLintUtils.RuleCreator<TypedLintingRuleDocs>(\r\n name => `https://github.com/DNNCommunity/dnn-elements/tree/main/packages/stencil-library/eslint-plugin/docs/${name}.md`\r\n);"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnncommunity/dnn-elements",
3
- "version": "0.24.3",
3
+ "version": "0.24.4-beta.11",
4
4
  "description": "Dnn themed custom elements.",
5
5
  "repository": "https://github.com/dnncommunity/dnn-elements",
6
6
  "homepage": "https://dnncommunity.github.io/dnn-elements",
@@ -15,10 +15,16 @@
15
15
  "unpkg": "dist/dnn/dnn.js",
16
16
  "files": [
17
17
  "dist/",
18
- "loader/"
18
+ "loader/",
19
+ "eslint-plugin/dist"
19
20
  ],
21
+ "exports": {
22
+ "./eslint-plugin": {
23
+ "import": "./eslint-plugin/dist/index.js"
24
+ }
25
+ },
20
26
  "scripts": {
21
- "build": "npm run eslint && stencil build --docs",
27
+ "build": "npm run build:eslint-plugin && npm run eslint && stencil build --docs",
22
28
  "postbuild": "license-checker-rseidelsohn --out licenses.json --json --direct --relativeLicensePath --relativeModulePath",
23
29
  "watch": "stencil build --dev --watch",
24
30
  "start": "stencil build --dev --watch --serve",
@@ -26,11 +32,14 @@
26
32
  "poststart": "license-checker-rseidelsohn --out licenses.json --json --direct --relativeLicensePath --relativeModulePath",
27
33
  "test": "stencil test --spec --e2e",
28
34
  "test.watch": "stencil test --spec --e2e --watchAll",
35
+ "test.eslint": "jest --config jest.eslint.config.js",
36
+ "test.eslint.watch": "jest --config jest.eslint.config.js --watchAll",
29
37
  "generate": "stencil generate",
30
38
  "eslint": "eslint",
31
39
  "storybook": "storybook dev -p 6006",
32
- "build-storybook": "storybook build",
33
- "deploy-storybook": "gh-pages -d storybook-static --branch site"
40
+ "build-storybook": "echo 'Storybook build is disabled for this release.'",
41
+ "deploy-storybook": "gh-pages -d storybook-static --branch site",
42
+ "build:eslint-plugin": "tsc -p eslint-plugin/tsconfig.json"
34
43
  },
35
44
  "devDependencies": {
36
45
  "@chromatic-com/storybook": "^3.1.0",
@@ -48,9 +57,12 @@
48
57
  "@storybook/web-components": "^8.3.2",
49
58
  "@storybook/web-components-webpack5": "^8.3.2",
50
59
  "@timkendrick/monaco-editor": "^0.0.9",
60
+ "@types/estree-jsx": "^1.0.5",
51
61
  "@types/jest": "^29.5.10",
52
- "@typescript-eslint/eslint-plugin": "^8.0.1",
53
- "@typescript-eslint/parser": "^8.0.1",
62
+ "@typescript-eslint/eslint-plugin": "^8.30.1",
63
+ "@typescript-eslint/parser": "^8.30.1",
64
+ "@typescript-eslint/rule-tester": "^8.30.1",
65
+ "@typescript-eslint/utils": "^8.30.1",
54
66
  "axe-playwright": "^2.0.1",
55
67
  "babel-loader": "^9.1.2",
56
68
  "eslint": "^8.57.0",
@@ -67,8 +79,9 @@
67
79
  "react-dom": "^18.2.0",
68
80
  "rollup-plugin-node-polyfills": "^0.2.1",
69
81
  "storybook": "^8.3.2",
82
+ "ts-jest": "^29.3.2",
70
83
  "typescript": "5.6.3",
71
- "typescript-debounce-decorator": "^0.0.18"
84
+ "typescript-eslint": "^8.30.1"
72
85
  },
73
86
  "dependencies": {
74
87
  "jodit": "^4.2.27"