@cocreate/position 1.3.29 → 1.5.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # [1.5.0](https://github.com/CoCreate-app/CoCreate-position/compare/v1.4.0...v1.5.0) (2023-08-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * bump cocreate dependencies for the latest updates and features ([768ee2e](https://github.com/CoCreate-app/CoCreate-position/commit/768ee2e01cc231daab0aeb7279a79bd552d952e5))
7
+
8
+ # [1.4.0](https://github.com/CoCreate-app/CoCreate-position/compare/v1.3.29...v1.4.0) (2023-08-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * crud attributes renamed ([22532c1](https://github.com/CoCreate-app/CoCreate-position/commit/22532c15ed88af676dd346bed48dec87d1679992))
14
+ * replace -target -selector ([ebf49da](https://github.com/CoCreate-app/CoCreate-position/commit/ebf49da7c075ef14d35d5938a1053f00dd84a575))
15
+ * webpack.config and package.json make use of mode=production instead of process.env ([9b6a33a](https://github.com/CoCreate-app/CoCreate-position/commit/9b6a33a7d5155f173a91a849d1ca941e1a24f784))
16
+
17
+
18
+ ### Features
19
+
20
+ * name attribute and variable renamed to key ([3184584](https://github.com/CoCreate-app/CoCreate-position/commit/3184584d8952f4222cedb11c8bdb0c540608176d))
21
+
1
22
  ## [1.3.29](https://github.com/CoCreate-app/CoCreate-position/compare/v1.3.28...v1.3.29) (2023-06-14)
2
23
 
3
24
 
@@ -4,8 +4,8 @@ module.exports = {
4
4
  "host": "",
5
5
  "sources": [
6
6
  {
7
- "collection": "files",
8
- "document": {
7
+ "array": "files",
8
+ "object": {
9
9
  "_id": "60206d5b3c260207bf49cab4",
10
10
  "name": "index.html",
11
11
  "path": "/docs/position/index.html",
package/docs/index.html CHANGED
@@ -11,10 +11,10 @@
11
11
  sizes="32x32"
12
12
  href="https://cocreate.app/images/favicon.ico" />
13
13
  <meta
14
- name="description"
14
+ key="description"
15
15
  content="A draggable, customizable Pop up that toggle hiddent content via attributes. Great for multitasking and showing multiple views." />
16
16
  <meta
17
- name="keywords"
17
+ key="keywords"
18
18
  content="helper classes, utility classes, css framework, css library, inline style classes" />
19
19
  <meta name="robots" content="index,follow" />
20
20
  <meta
@@ -24,9 +24,9 @@
24
24
  <link
25
25
  rel="stylesheet"
26
26
  href="/docs/index.css"
27
- collection="files"
28
- document_id="60888216117c640e7596303f"
29
- name="src"
27
+ array="files"
28
+ object="60888216117c640e7596303f"
29
+ key="src"
30
30
  type="text/css"
31
31
  save="true" />
32
32
  <link rel="manifest" href="/manifest.webmanifest" />
@@ -39,20 +39,20 @@
39
39
  scroll="sticky-nav,hide-nav"
40
40
  scroll-up="10"
41
41
  scroll-down="10"
42
- collection="files"
43
- document_id="60395ef42b3ac232657040fd"
44
- name="src"></nav>
42
+ array="files"
43
+ object="60395ef42b3ac232657040fd"
44
+ key="src"></nav>
45
45
  <sidenav
46
46
  id="menuL"
47
47
  class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
48
48
  resizable
49
- resize-target="[content_id='content']"
49
+ resize-selector="[content_id='content']"
50
50
  resize-property="margin-left"
51
51
  resize-value="width">
52
52
  <menu
53
- collection="files"
54
- document_id="603717b07de7fb350ae9fec8"
55
- name="src"></menu>
53
+ array="files"
54
+ object="603717b07de7fb350ae9fec8"
55
+ key="src"></menu>
56
56
  <div resize="right"></div>
57
57
  </sidenav>
58
58
  <main
@@ -75,7 +75,7 @@
75
75
  share-width="700"
76
76
  share-media="https://cdn.cocreate.app/docs/position.png"
77
77
  hover="display:block!important"
78
- hover-target=".social-networks">
78
+ hover-selector=".social-networks">
79
79
  <div class="display:none social-networks">
80
80
  <a
81
81
  class="margin-right:15px"
@@ -134,11 +134,11 @@
134
134
  class="margin-top:80px border-bottom:1px_solid_lightgrey"
135
135
  scroll
136
136
  scroll-intersect="color:dodgerblue"
137
- scroll-target="#position-usage-section">
137
+ scroll-selector="#position-usage-section">
138
138
  <span
139
139
  class="display:flex align-items:center width:fit-content"
140
140
  hover="display:block!important"
141
- hover-target="[href='#position-usage']">
141
+ hover-selector="[href='#position-usage']">
142
142
  <h2 class="padding:5px_0px">Usage</h2>
143
143
  <a
144
144
  class="margin-left:10px display:none"
@@ -183,11 +183,11 @@
183
183
  class="margin-top:80px border-bottom:1px_solid_lightgrey"
184
184
  scroll
185
185
  scroll-intersect="color:dodgerblue"
186
- scroll-target="#position-attributes-section">
186
+ scroll-selector="#position-attributes-section">
187
187
  <span
188
188
  class="display:flex align-items:center width:fit-content"
189
189
  hover="display:block!important"
190
- hover-target="[href='#position-attributes']">
190
+ hover-selector="[href='#position-attributes']">
191
191
  <h2 class="padding:5px_0px">Attributes</h2>
192
192
  <a
193
193
  class="margin-left:10px display:none"
@@ -352,11 +352,11 @@
352
352
  class="border-bottom:1px_solid_lightgrey"
353
353
  scroll
354
354
  scroll-intersect="color:dodgerblue"
355
- scroll-target="#position-demo-section">
355
+ scroll-selector="#position-demo-section">
356
356
  <span
357
357
  class="display:flex align-items:center width:fit-content"
358
358
  hover="display:block!important"
359
- hover-target="[href='#position-demo']">
359
+ hover-selector="[href='#position-demo']">
360
360
  <h2 class="padding:5px_0px">Demo</h2>
361
361
  <a
362
362
  class="margin-left:10px display:none"
@@ -380,9 +380,9 @@
380
380
  <textarea
381
381
  type="code"
382
382
  lang="html"
383
- collection="demos"
384
- document_id=""
385
- name="demo"
383
+ array="demos"
384
+ object=""
385
+ key="demo"
386
386
  save="false"
387
387
  id="demo"
388
388
  class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
@@ -405,7 +405,7 @@
405
405
  show="#eye-slash"
406
406
  hide="#eye, #demo-preview"
407
407
  toggle="code-height"
408
- toggle-target="#demo-code"
408
+ toggle-selector="#demo-code"
409
409
  ><i
410
410
  class="height:18px fill:#505050"
411
411
  src="/assets/svg/eye.svg"></i
@@ -417,7 +417,7 @@
417
417
  show="#eye, #demo-preview"
418
418
  hide="#eye-slash"
419
419
  toggle="code-height"
420
- toggle-target="#demo-code"
420
+ toggle-selector="#demo-code"
421
421
  ><i
422
422
  class="height:20px fill:#505050"
423
423
  src="/assets/svg/eye-slash.svg"></i
@@ -444,7 +444,7 @@
444
444
  <a
445
445
  class="margin-right:5px"
446
446
  fullscreen
447
- fullscreen-target="#playground"></a>
447
+ fullscreen-selector="#playground"></a>
448
448
  </div>
449
449
  </div>
450
450
  <!-- End SandBox -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/position",
3
- "version": "1.3.29",
3
+ "version": "1.5.0",
4
4
  "description": "Make any element draggable and movable. Customizable via attributes, great for popups, alerts, multitasking and displaying multiple views.",
5
5
  "keywords": [
6
6
  "position",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "scripts": {
27
27
  "start": "npx webpack --config webpack.config.js",
28
- "build": "NODE_ENV=production npx webpack --config webpack.config.js",
28
+ "build": "npx webpack --mode=production --config webpack.config.js",
29
29
  "dev": "npx webpack --config webpack.config.js --watch",
30
30
  "postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
31
31
  },
@@ -58,6 +58,6 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/observer": "^1.8.18"
61
+ "@cocreate/observer": "^1.9.0"
62
62
  }
63
63
  }
package/webpack.config.js CHANGED
@@ -1,84 +1,90 @@
1
1
  const path = require("path")
2
2
  const TerserPlugin = require("terser-webpack-plugin")
3
3
  const MiniCssExtractPlugin = require("mini-css-extract-plugin")
4
- let isProduction = process.env.NODE_ENV === "production"
5
4
  const { CleanWebpackPlugin } = require("clean-webpack-plugin")
6
5
 
7
- module.exports = {
8
- entry: {
9
- "CoCreate-position": "./src/index.js",
10
- },
11
- output: {
12
- path: path.resolve(__dirname, "dist"),
13
- filename: isProduction ? "[name].min.js" : "[name].js",
14
- libraryTarget: "umd",
15
- libraryExport: "default",
16
- library: ["CoCreate", "position"],
17
- globalObject: "this",
18
- },
6
+ module.exports = (env, argv) => {
7
+ let isProduction = false
8
+ if (argv.mode === 'production')
9
+ isProduction = true
19
10
 
20
- plugins: [
21
- new CleanWebpackPlugin(),
22
- new MiniCssExtractPlugin({
23
- filename: "[name].css",
24
- }),
25
- ],
26
- // Default mode for Webpack is production.
27
- // Depending on mode Webpack will apply different things
28
- // on final bundle. For now we don't need production's JavaScript
29
- // minifying and other thing so let's set mode to development
30
- mode: isProduction ? "production" : "development",
31
- module: {
32
- rules: [
33
- {
34
- test: /.js$/,
35
- exclude: /(node_modules)/,
36
- use: {
37
- loader: "babel-loader",
38
- options: {
39
- plugins: ["@babel/plugin-transform-modules-commonjs"],
40
- },
11
+ const config = {
12
+ entry: {
13
+ "CoCreate-position": "./src/index.js",
41
14
  },
42
- },
43
- {
44
- test: /.css$/i,
45
- use: [
46
- { loader: "style-loader", options: { injectType: "linkTag" } },
47
- "file-loader",
15
+ output: {
16
+ path: path.resolve(__dirname, "dist"),
17
+ filename: isProduction ? "[name].min.js" : "[name].js",
18
+ libraryTarget: "umd",
19
+ libraryExport: "default",
20
+ library: ["CoCreate", "position"],
21
+ globalObject: "this",
22
+ },
23
+
24
+ plugins: [
25
+ new CleanWebpackPlugin(),
26
+ new MiniCssExtractPlugin({
27
+ filename: "[name].css",
28
+ }),
48
29
  ],
49
- },
50
- ],
51
- },
30
+ // Default mode for Webpack is production.
31
+ // Depending on mode Webpack will apply different things
32
+ // on final bundle. For now we don't need production's JavaScript
33
+ // minifying and other thing so let's set mode to development
34
+ mode: isProduction ? "production" : "development",
35
+ module: {
36
+ rules: [
37
+ {
38
+ test: /.js$/,
39
+ exclude: /(node_modules)/,
40
+ use: {
41
+ loader: "babel-loader",
42
+ options: {
43
+ plugins: ["@babel/plugin-transform-modules-commonjs"],
44
+ },
45
+ },
46
+ },
47
+ {
48
+ test: /.css$/i,
49
+ use: [
50
+ { loader: "style-loader", options: { injectType: "linkTag" } },
51
+ "file-loader",
52
+ ],
53
+ },
54
+ ],
55
+ },
52
56
 
53
- // add source map
54
- ...(isProduction ? {} : { devtool: "eval-source-map" }),
57
+ // add source map
58
+ ...(isProduction ? {} : { devtool: "eval-source-map" }),
55
59
 
56
- optimization: {
57
- minimize: true,
58
- minimizer: [
59
- new TerserPlugin({
60
- extractComments: true,
61
- // cache: true,
62
- parallel: true,
63
- // sourceMap: true, // Must be set to true if using source-maps in production
64
- terserOptions: {
65
- // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
66
- // extractComments: 'all',
67
- compress: {
68
- drop_console: true,
69
- },
70
- },
71
- }),
72
- ],
73
- splitChunks: {
74
- chunks: "all",
75
- minSize: 200,
76
- // maxSize: 99999,
77
- //minChunks: 1,
60
+ optimization: {
61
+ minimize: true,
62
+ minimizer: [
63
+ new TerserPlugin({
64
+ extractComments: true,
65
+ // cache: true,
66
+ parallel: true,
67
+ // sourceMap: true, // Must be set to true if using source-maps in production
68
+ terserOptions: {
69
+ // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
70
+ // extractComments: 'all',
71
+ compress: {
72
+ drop_console: true,
73
+ },
74
+ },
75
+ }),
76
+ ],
77
+ splitChunks: {
78
+ chunks: "all",
79
+ minSize: 200,
80
+ // maxSize: 99999,
81
+ //minChunks: 1,
78
82
 
79
- cacheGroups: {
80
- defaultVendors: false,
81
- },
82
- },
83
- },
84
- }
83
+ cacheGroups: {
84
+ defaultVendors: false,
85
+ },
86
+ },
87
+ },
88
+ }
89
+ return config
90
+ }