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

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"}
@@ -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"}
@@ -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":3,"file":"no-label-slot-in-checkbox.js","sourceRoot":"","sources":["../../../../src/rules/no-label-slot-in-checkbox.ts"],"names":[],"mappings":";;;AAAA,oCAAsC;AAEzB,QAAA,IAAI,GAAG,IAAA,kBAAU,EAAC;IAC3B,IAAI,EAAE,2BAA2B;IACjC,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACF,IAAI,EAAE;YACF,WAAW,EAAE,iCAAiC;YAC9C,WAAW,EAAE,IAAI;YACjB,GAAG,EAAE,mEAAmE;SAC3E;QACD,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACN,qBAAqB,EAAE,oFAAoF;SAC9G;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE,EAAE,uFAAuF;KACtG;IACD,MAAM,CAAC,OAAO;QACV,OAAO;YACH,UAAU,CAAC,IAAI;gBACX,IACI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBACjD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,EAClD,CAAC;oBACC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ;yBAC7B,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;yBAC/C,IAAI,CAAC,EAAE,CAAC;yBACR,IAAI,EAAE,CAAC;oBAEZ,IAAI,YAAY,EAAE,CAAC;wBACf,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,uBAAuB;4BAClC,GAAG,EAAE,KAAK,CAAC,EAAE;gCACT,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gCACrE,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gCAEtD,MAAM,WAAW,GAAG,YAAY,WAAW,KAAK,YAAY,YAAY,CAAC;gCACzE,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"}
@@ -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"}
@@ -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"}
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@dnncommunity/dnn-elements",
3
+ "version": "0.24.4-beta.10",
4
+ "description": "Dnn themed custom elements.",
5
+ "repository": "https://github.com/dnncommunity/dnn-elements",
6
+ "homepage": "https://dnncommunity.github.io/dnn-elements",
7
+ "license": "MIT",
8
+ "main": "dist/index.cjs.js",
9
+ "module": "dist/index.js",
10
+ "es2015": "dist/esm/index.mjs",
11
+ "es2017": "dist/esm/index.mjs",
12
+ "types": "dist/types/index.d.ts",
13
+ "collection": "dist/collection/collection-manifest.json",
14
+ "collection:main": "dist/collection/index.js",
15
+ "unpkg": "dist/dnn/dnn.js",
16
+ "files": [
17
+ "dist/",
18
+ "loader/",
19
+ "eslint-plugin/dist"
20
+ ],
21
+ "exports": {
22
+ "./eslint": {
23
+ "import": "./eslint-plugin/dist/index.js"
24
+ }
25
+ },
26
+ "scripts": {
27
+ "build": "npm run build:eslint-plugin && npm run eslint && stencil build --docs",
28
+ "postbuild": "license-checker-rseidelsohn --out licenses.json --json --direct --relativeLicensePath --relativeModulePath",
29
+ "watch": "stencil build --dev --watch",
30
+ "start": "stencil build --dev --watch --serve",
31
+ "start.edge": "stencil build --dev --watch --serve --es5",
32
+ "poststart": "license-checker-rseidelsohn --out licenses.json --json --direct --relativeLicensePath --relativeModulePath",
33
+ "test": "stencil test --spec --e2e",
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",
37
+ "generate": "stencil generate",
38
+ "eslint": "eslint",
39
+ "storybook": "storybook dev -p 6006",
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"
43
+ },
44
+ "devDependencies": {
45
+ "@chromatic-com/storybook": "^3.1.0",
46
+ "@stencil-community/eslint-plugin": "0.9.0",
47
+ "@stencil/core": "4.22.2",
48
+ "@stencil/react-output-target": "^0.5.1",
49
+ "@stencil/sass": "^3.0.4",
50
+ "@storybook/addon-a11y": "^8.3.2",
51
+ "@storybook/addon-essentials": "^8.3.2",
52
+ "@storybook/addon-links": "^8.3.2",
53
+ "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
54
+ "@storybook/addons": "^7.6.17",
55
+ "@storybook/blocks": "^8.3.2",
56
+ "@storybook/theming": "^8.3.2",
57
+ "@storybook/web-components": "^8.3.2",
58
+ "@storybook/web-components-webpack5": "^8.3.2",
59
+ "@timkendrick/monaco-editor": "^0.0.9",
60
+ "@types/estree-jsx": "^1.0.5",
61
+ "@types/jest": "^29.5.10",
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",
66
+ "axe-playwright": "^2.0.1",
67
+ "babel-loader": "^9.1.2",
68
+ "eslint": "^8.57.0",
69
+ "eslint-plugin-react": "^7.16.0",
70
+ "eslint-plugin-storybook": "^0.11.1",
71
+ "gh-pages": "^6.0.0",
72
+ "jest": "^29.7.0",
73
+ "jest-cli": "^29.7.0",
74
+ "license-checker-rseidelsohn": "^4.2.6",
75
+ "lit": "^3.1.0",
76
+ "npm-run-all": "^4.1.5",
77
+ "puppeteer": "^23.9.0",
78
+ "react": "^18.2.0",
79
+ "react-dom": "^18.2.0",
80
+ "rollup-plugin-node-polyfills": "^0.2.1",
81
+ "storybook": "^8.3.2",
82
+ "ts-jest": "^29.3.2",
83
+ "typescript": "5.6.3",
84
+ "typescript-eslint": "^8.30.1"
85
+ },
86
+ "dependencies": {
87
+ "jodit": "^4.2.27"
88
+ }
89
+ }
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.10",
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": {
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"