@cocreate/print 1.0.2 → 1.0.4

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.
@@ -22,13 +22,13 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
24
  - name: Checkout
25
- uses: actions/checkout@v3
25
+ uses: actions/checkout@v4
26
26
  - name: Setup Node.js
27
- uses: actions/setup-node@v3
27
+ uses: actions/setup-node@v4
28
28
  with:
29
- node-version: 14
29
+ node-version: 22 # Required for the latest semantic-release plugins
30
30
  - name: Semantic Release
31
- uses: cycjimmy/semantic-release-action@v3
31
+ uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
32
32
  id: semantic
33
33
  with:
34
34
  extra_plugins: |
@@ -36,9 +36,8 @@ jobs:
36
36
  @semantic-release/git
37
37
  @semantic-release/github
38
38
  env:
39
- GITHUB_TOKEN: "${{ secrets.GITHUB }}"
39
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
40
40
  NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
41
41
  outputs:
42
42
  new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
43
  new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
-
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## [1.0.4](https://github.com/CoCreate-app/CoCreate-print/compare/v1.0.3...v1.0.4) (2026-02-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update worklow ([b936bf9](https://github.com/CoCreate-app/CoCreate-print/commit/b936bf926d3691a8630a59a35553f1255404e451))
7
+
8
+ ## [1.0.3](https://github.com/CoCreate-app/CoCreate-print/compare/v1.0.2...v1.0.3) (2025-05-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * added css-loader ([5dbcad6](https://github.com/CoCreate-app/CoCreate-print/commit/5dbcad68fe262c6a270ebc7904b805735a1d3e68))
14
+ * update [@cocreate](https://github.com/cocreate) dependencies ([680c5ea](https://github.com/CoCreate-app/CoCreate-print/commit/680c5ea73f378ed8d862279ba7d5900b6011914b))
15
+ * update query attributes ([c81e808](https://github.com/CoCreate-app/CoCreate-print/commit/c81e8081a718e5725f34b5f82ea34dbc0b01c412))
16
+ * webpack.config and devdependencies ([0a7072b](https://github.com/CoCreate-app/CoCreate-print/commit/0a7072b0dfb21a962fa9e4d333dbba91befcb257))
17
+
1
18
  ## [1.0.2](https://github.com/CoCreate-app/CoCreate-print/compare/v1.0.1...v1.0.2) (2024-12-14)
2
19
 
3
20
 
package/docs/index.html CHANGED
@@ -180,7 +180,7 @@
180
180
  show="#eye-slash"
181
181
  hide="#eye, #demo-preview"
182
182
  toggle="code-height"
183
- toggle-selector="#demo-code"
183
+ toggle-query="#demo-code"
184
184
  ><i
185
185
  class="height:18px"
186
186
  src="/assets/svg/eye.svg"></i
@@ -192,7 +192,7 @@
192
192
  show="#eye, #demo-preview"
193
193
  hide="#eye-slash"
194
194
  toggle="code-height"
195
- toggle-selector="#demo-code"
195
+ toggle-query="#demo-code"
196
196
  ><i src="/assets/svg/eye-slash.svg"></i
197
197
  ></a>
198
198
  <a
@@ -215,7 +215,7 @@
215
215
  <a
216
216
  class="margin-right:5px"
217
217
  fullscreen
218
- fullscreen-selector="#playground"></a>
218
+ fullscreen-query="#playground"></a>
219
219
  </div>
220
220
  </div>
221
221
  <!-- End SandBox -->
package/package.json CHANGED
@@ -1,18 +1,10 @@
1
1
  {
2
2
  "name": "@cocreate/print",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A simple print component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "print",
7
- "cocreate",
8
- "low-code-framework",
9
- "no-code-framework",
10
- "cocreatejs",
11
- "cocreatejs-component",
12
- "cocreate-framework",
13
- "no-code",
14
7
  "low-code",
15
- "collaborative-framework",
16
8
  "realtime",
17
9
  "realtime-framework",
18
10
  "collaboration",
@@ -45,21 +37,18 @@
45
37
  },
46
38
  "main": "./src/index.js",
47
39
  "devDependencies": {
48
- "@babel/core": "^7.9.6",
49
- "@babel/preset-env": "^7.9.6",
50
- "babel-loader": "^8.1.0",
51
- "clean-webpack-plugin": "^3.0.0",
52
- "file-loader": "^6.2.0",
40
+ "css-loader": "^5.1.3",
41
+ "esbuild": "^0.25.2",
42
+ "esbuild-loader": "^4.3.0",
53
43
  "mini-css-extract-plugin": "^1.5.0",
54
- "style-loader": "^3.3.1",
55
- "terser-webpack-plugin": "^5.1.1",
56
44
  "webpack": "^5.24.4",
57
45
  "webpack-cli": "^4.5.0",
58
46
  "webpack-log": "^3.0.1"
59
47
  },
60
48
  "dependencies": {
61
- "@cocreate/actions": "1.20.0",
62
- "@cocreate/observer": "1.17.0",
63
- "@cocreate/utils": "1.37.0"
49
+ "@cocreate/actions": "^1.21.1",
50
+ "@cocreate/element-prototype": "^1.29.1",
51
+ "@cocreate/observer": "^1.18.1",
52
+ "@cocreate/utils": "^1.39.0"
64
53
  }
65
54
  }
package/src/index.js CHANGED
@@ -10,8 +10,7 @@ import { queryElements } from "@cocreate/utils";
10
10
  import Actions from "@cocreate/actions";
11
11
  import Observer from "@cocreate/observer";
12
12
 
13
- const selector =
14
- "[print-selector], [print-closest], [print-parent], [print-next], [print-previous]";
13
+ const selector = "[print-query]";
15
14
 
16
15
  function init(element) {
17
16
  if (!element) {
@@ -46,8 +45,10 @@ function initElement(element) {
46
45
  }
47
46
 
48
47
  function queryPrintElement(element) {
49
- let elements = queryElements({ element, prefix: "print" });
50
- if (elements === false) {
48
+ let elements = [];
49
+ if (element.hasAttribute("print-query")) {
50
+ elements = queryElements({ element, prefix: "print" });
51
+ } else {
51
52
  elements = [element];
52
53
  }
53
54
  print(elements);
@@ -132,7 +133,7 @@ Actions.init([
132
133
 
133
134
  Observer.init({
134
135
  name: "CoCreatePrintAddedNodes",
135
- observe: ["addedNodes"],
136
+ types: ["addedNodes"],
136
137
  selector,
137
138
  callback(mutation) {
138
139
  initElement(mutation.target);
@@ -141,14 +142,8 @@ Observer.init({
141
142
 
142
143
  Observer.init({
143
144
  name: "CoCreatePrintObserver",
144
- observe: ["attributes"],
145
- attributeName: [
146
- "print-selector",
147
- "print-closest",
148
- "print-parent",
149
- "print-next",
150
- "print-previous"
151
- ],
145
+ types: ["attributes"],
146
+ attributeFilter: ["print-query"],
152
147
  selector,
153
148
  callback: function (mutation) {
154
149
  initElement(mutation.target);
package/webpack.config.js CHANGED
@@ -1,94 +1,65 @@
1
- const path = require("path");
2
- const TerserPlugin = require("terser-webpack-plugin");
3
- const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4
- const { CleanWebpackPlugin } = require("clean-webpack-plugin");
5
-
6
- module.exports = (env, argv) => {
7
- let isProduction = false;
8
- if (argv.mode === "production") isProduction = true;
9
-
10
- const config = {
11
- entry: {
12
- "CoCreate-print": "./src/index.js"
13
- },
14
- output: {
15
- path: path.resolve(__dirname, "dist"),
16
- filename: isProduction ? "[name].min.js" : "[name].js",
17
- libraryTarget: "umd",
18
- libraryExport: "default",
19
- library: ["CoCreate", "print"],
20
- globalObject: "this"
21
- },
22
-
23
- plugins: [
24
- new CleanWebpackPlugin(),
25
- new MiniCssExtractPlugin({
26
- filename: "[name].css"
27
- })
28
- ],
29
- // Default mode for Webpack is production.
30
- // Depending on mode Webpack will apply different things
31
- // on final bundle. For now we don't need production's JavaScript
32
- // minifying and other thing so let's set mode to development
33
- mode: isProduction ? "production" : "development",
34
- module: {
35
- rules: [
36
- {
37
- test: /.js$/,
38
- exclude: /(node_modules)/,
39
- use: {
40
- loader: "babel-loader",
41
- options: {
42
- plugins: [
43
- "@babel/plugin-transform-modules-commonjs"
44
- ]
45
- }
46
- }
47
- },
48
- {
49
- test: /.css$/i,
50
- use: [
51
- {
52
- loader: "style-loader",
53
- options: { injectType: "linkTag" }
54
- },
55
- "file-loader"
56
- ]
57
- }
58
- ]
59
- },
60
-
61
- // add source map
62
- ...(isProduction ? {} : { devtool: "eval-source-map" }),
63
-
64
- optimization: {
65
- minimize: true,
66
- minimizer: [
67
- new TerserPlugin({
68
- extractComments: true,
69
- // cache: true,
70
- parallel: true,
71
- // sourceMap: true, // Must be set to true if using source-maps in production
72
- terserOptions: {
73
- // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
74
- // extractComments: 'all',
75
- compress: {
76
- drop_console: true
77
- }
78
- }
79
- })
80
- ],
81
- splitChunks: {
82
- chunks: "all",
83
- minSize: 200,
84
- // maxSize: 99999,
85
- //minChunks: 1,
86
-
87
- cacheGroups: {
88
- defaultVendors: false
89
- }
90
- }
91
- }
92
- };
93
- return config;
94
- };
1
+ const path = require("path");
2
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3
+ const { EsbuildPlugin } = require("esbuild-loader");
4
+ const { FileUploader } = require("@cocreate/webpack");
5
+
6
+ module.exports = async (env, argv) => {
7
+ const isProduction = argv && argv.mode === "production";
8
+ const config = {
9
+ entry: {
10
+ "CoCreate-print": "./src/index.js"
11
+ },
12
+ output: {
13
+ path: path.resolve(__dirname, "dist"),
14
+ filename: isProduction ? "[name].min.js" : "[name].js",
15
+ libraryExport: "default",
16
+ library: ["CoCreate", "print"],
17
+ clean: true
18
+ },
19
+ plugins: [
20
+ new MiniCssExtractPlugin({
21
+ filename: isProduction ? "[name].min.css" : "[name].css"
22
+ }),
23
+ new FileUploader(env, argv)
24
+ ],
25
+ mode: isProduction ? "production" : "development",
26
+ devtool: isProduction ? "source-map" : "eval-source-map",
27
+ module: {
28
+ rules: [
29
+ {
30
+ test: /.js$/,
31
+ exclude: /node_modules/,
32
+ use: {
33
+ loader: "esbuild-loader",
34
+ options: {
35
+ loader: "js",
36
+ target: "es2017"
37
+ }
38
+ }
39
+ },
40
+ {
41
+ test: /.css$/i,
42
+ use: [MiniCssExtractPlugin.loader, "css-loader"]
43
+ }
44
+ ]
45
+ },
46
+ optimization: {
47
+ minimize: isProduction,
48
+ minimizer: [
49
+ new EsbuildPlugin({
50
+ target: "es2017",
51
+ css: true
52
+ })
53
+ ],
54
+ splitChunks: {
55
+ cacheGroups: {
56
+ defaultVendors: false
57
+ }
58
+ }
59
+ },
60
+ performance: {
61
+ hints: isProduction ? "warning" : false
62
+ }
63
+ };
64
+ return config;
65
+ };