p-elements-core 2.0.15 → 2.1.0-rc3

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.
Files changed (68) hide show
  1. package/.gitlab-ci.yml +18 -16
  2. package/.vscode/launch.json +52 -0
  3. package/build.mjs +48 -0
  4. package/dist/p-elements-core.js +4 -71
  5. package/dist/sample/sample.js +29 -0
  6. package/index.html +25 -155
  7. package/package.json +36 -56
  8. package/readme.md +206 -0
  9. package/src/custom-element-controller.ts +31 -0
  10. package/src/custom-element.ts +304 -129
  11. package/src/custom-style-element.ts +22 -18
  12. package/src/decorators/bind.ts +12 -6
  13. package/src/decorators/custom-element-config.ts +9 -9
  14. package/src/decorators/property.ts +150 -0
  15. package/src/decorators/query.ts +12 -0
  16. package/src/decorators/render-property-on-set.ts +3 -0
  17. package/src/helpers/css.ts +71 -0
  18. package/src/{cache.ts → maquette/cache.ts} +5 -5
  19. package/src/{dom.ts → maquette/dom.ts} +25 -10
  20. package/src/{h.ts → maquette/h.ts} +24 -17
  21. package/src/maquette/index.ts +12 -0
  22. package/src/{interfaces.ts → maquette/interfaces.ts} +106 -24
  23. package/src/maquette/jsx.ts +61 -0
  24. package/src/{mapping.ts → maquette/mapping.ts} +7 -6
  25. package/src/{projection.ts → maquette/projection.ts} +251 -123
  26. package/src/{projector.ts → maquette/projector.ts} +67 -35
  27. package/src/p-elements-core.ts +91 -0
  28. package/src/sample/mixin/highlight.tsx +32 -0
  29. package/src/sample/sample.tsx +367 -0
  30. package/tsconfig.json +62 -13
  31. package/types/custom-element-controller.d.ts +17 -0
  32. package/types/custom-element.d.ts +27 -0
  33. package/types/custom-style-element.d.ts +4 -0
  34. package/types/decorators/bind.d.ts +5 -0
  35. package/types/decorators/custom-element-config.d.ts +7 -0
  36. package/types/decorators/property.d.ts +17 -0
  37. package/types/decorators/query.d.ts +1 -0
  38. package/types/decorators/render-property-on-set.d.ts +1 -0
  39. package/types/helpers/css.d.ts +3 -0
  40. package/types/maquette/cache.d.ts +9 -0
  41. package/types/maquette/dom.d.ts +59 -0
  42. package/types/maquette/h.d.ts +34 -0
  43. package/types/maquette/index.d.ts +11 -0
  44. package/types/maquette/interfaces.d.ts +474 -0
  45. package/types/maquette/jsx.d.ts +5 -0
  46. package/types/maquette/mapping.d.ts +13 -0
  47. package/types/maquette/projection.d.ts +8 -0
  48. package/types/maquette/projector.d.ts +26 -0
  49. package/types/p-elements-core.d.ts +55 -0
  50. package/dist/p-elements-core-modern.js +0 -72
  51. package/dist/sample.js +0 -20
  52. package/karma.conf.js +0 -32
  53. package/p-elements-core.d.ts +0 -141
  54. package/screen.css +0 -16
  55. package/src/bar.css +0 -3
  56. package/src/commonjs.js +0 -182
  57. package/src/custom-inline-style-element.ts +0 -42
  58. package/src/decorators/property-render-on-set.ts +0 -49
  59. package/src/decorators/reflect-to-attribute.ts +0 -51
  60. package/src/index.tsx +0 -84
  61. package/src/sample.css +0 -19
  62. package/src/sample.spec.ts +0 -112
  63. package/src/sample.tsx +0 -187
  64. package/src/tsconfig.json +0 -16
  65. package/theme.css +0 -12
  66. package/tslint.json +0 -33
  67. package/webpack.config.js +0 -100
  68. package/webpack.config.karma.js +0 -35
package/.gitlab-ci.yml CHANGED
@@ -1,16 +1,18 @@
1
- image: node:6.9-alpine
2
- before_script:
3
- - apk update && apk upgrade
4
- - apk add --no-cache bash git openssh
5
-
6
- pages:
7
- stage: deploy
8
- script:
9
- - mkdir public
10
- - tar -c --exclude .git --exclude node_modules . | tar -x -C public
11
- artifacts:
12
- paths:
13
- - public
14
- only:
15
- - master
16
-
1
+ # The Docker image that will be used to build your app
2
+ image: node:lts
3
+ create-pages:
4
+ pages:
5
+ # The folder that contains the files to be exposed at the Page URL
6
+ publish: docs/public
7
+ rules:
8
+ # This ensures that only pushes to the default branch will trigger
9
+ # a pages deploy
10
+ - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
11
+ - if: $CI_COMMIT_REF_NAME == "pages"
12
+ # Functions that should be executed before the build script is run
13
+ before_script:
14
+ - cd docs
15
+ - npm ci
16
+ - npm run build
17
+ script:
18
+ - npm ci
@@ -0,0 +1,52 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "type": "bun",
6
+ "request": "launch",
7
+ "name": "Debug Bun",
8
+
9
+ // The path to a JavaScript or TypeScript file to run.
10
+ "program": "${file}",
11
+
12
+ // The arguments to pass to the program, if any.
13
+ "args": [],
14
+
15
+ // The working directory of the program.
16
+ "cwd": "${workspaceFolder}",
17
+
18
+ // The environment variables to pass to the program.
19
+ "env": {},
20
+
21
+ // If the environment variables should not be inherited from the parent process.
22
+ "strictEnv": false,
23
+
24
+ // If the program should be run in watch mode.
25
+ // This is equivalent to passing `--watch` to the `bun` executable.
26
+ // You can also set this to "hot" to enable hot reloading using `--hot`.
27
+ "watchMode": false,
28
+
29
+ // If the debugger should stop on the first line of the program.
30
+ "stopOnEntry": false,
31
+
32
+ // If the debugger should be disabled. (for example, breakpoints will not be hit)
33
+ "noDebug": false,
34
+
35
+ // The path to the `bun` executable, defaults to your `PATH` environment variable.
36
+ "runtime": "bun",
37
+
38
+ // The arguments to pass to the `bun` executable, if any.
39
+ // Unlike `args`, these are passed to the executable itself, not the program.
40
+ "runtimeArgs": [],
41
+ },
42
+ {
43
+ "type": "bun",
44
+ "request": "attach",
45
+ "name": "Attach to Bun",
46
+
47
+ // The URL of the WebSocket inspector to attach to.
48
+ // This value can be retrieved by using `bun --inspect`.
49
+ "url": "ws://localhost:6499/",
50
+ }
51
+ ]
52
+ }
package/build.mjs ADDED
@@ -0,0 +1,48 @@
1
+
2
+ import esbuild from "esbuild";
3
+ import {createServer} from "http"
4
+ import express from "express";
5
+ import fs from "fs";
6
+
7
+
8
+ const pkg = JSON.parse(fs.readFileSync("./package.json", "utf8"));
9
+
10
+ const isWatch = process.argv.indexOf("--watch") > -1;
11
+
12
+
13
+ const buildOptions = {
14
+ entryPoints: ["src/p-elements-core.ts", "src/sample/sample.tsx"],
15
+ bundle: true,
16
+ target: "es6",
17
+ outdir: "./dist/",
18
+ format: "esm",
19
+ sourcemap: isWatch,
20
+ minify: !isWatch,
21
+ plugins: [],
22
+ banner: {
23
+ js: `// P-ELEMENTS ${pkg.version} - ${new Date()}\n`,
24
+ },
25
+ };
26
+
27
+ if (!isWatch) {
28
+ esbuild.build({
29
+ ...buildOptions,
30
+ }).catch(() => process.exit(1));
31
+
32
+ } else {
33
+ const app = express({});
34
+ const server = createServer(app);
35
+ app.use((req, res, next) => {
36
+ res.header("Access-Control-Allow-Origin", "*");
37
+ res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
38
+ next();
39
+ });
40
+ const serverOptions = {host: "localhost", port: 5001};
41
+ app.use(express.static("./") );
42
+ server.listen(serverOptions);
43
+
44
+ (async () => {
45
+ const ctx = await esbuild.context(buildOptions);
46
+ await ctx.watch();
47
+ })();
48
+ }