@cocreate/render 1.53.0 → 2.0.1

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/CONTRIBUTING.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Contributing to CoCreate-render
2
2
 
3
- This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-render/graphs/contributors).
4
- You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-render/pulls),
5
- [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-render/issues).
3
+ This project is work of [many contributors](https://github.com/CoCreateJS/render/graphs/contributors).
4
+ You're encouraged to submit [pull requests](https://github.com/CoCreateJS/render/pulls),
5
+ [propose features and discuss issues](https://github.com/CoCreateJS/render/issues).
6
6
 
7
7
  In the examples below, substitute your Github username for `contributor` in URLs.
8
8
 
9
9
  ## Fork the Project
10
10
 
11
- Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-render) and check out your copy.
11
+ Fork the [project on Github](https://github.com/CoCreateJS/render) and check out your copy.
12
12
 
13
13
  ```
14
14
  git render https://github.com/contributor/CoCreate-render.git
15
15
  cd CoCreate-render
16
- git remote add upstream https://gitlab.com/cocreatejs/CoCreate-render.git
16
+ git remote add upstream https://github.com/CoCreateJS/render.git
17
17
  ```
18
18
 
19
19
  ## Create a Topic Branch
@@ -75,7 +75,7 @@ git push origin my-feature-branch
75
75
 
76
76
  ## Make a Pull Request
77
77
 
78
- Go to [https://github.com/CoCreate-app/CoCreate-render](https://github.com/CoCreate-app/CoCreate-render) and select your feature branch.
78
+ Go to [https://github.com/CoCreateJS/render](https://github.com/CoCreateJS/render) and select your feature branch.
79
79
  Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
80
80
 
81
81
  ## Rebase
package/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # CoCreate-render
2
2
 
3
- A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/render)
3
+ A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API. Take it for a spin in our [playground!](https://CoCreateJS.com/docs/render)
4
4
 
5
- ![minified](https://img.badgesize.io/https://cdn.cocreate.app/render/latest/CoCreate-render.min.js?style=flat-square&label=minified&color=orange)
6
- ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/render/latest/CoCreate-render.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
7
- ![brotli](https://img.badgesize.io/https://cdn.cocreate.app/render/latest/CoCreate-render.min.js?compression=brotli&style=flat-square&label=brotli)
8
- ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-render?style=flat-square)
9
- ![License](https://img.shields.io/github/license/CoCreate-app/CoCreate-render?style=flat-square)
5
+ ![minified](https://img.badgesize.io/https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.js?style=flat-square&label=minified&color=orange)
6
+ ![gzip](https://img.badgesize.io/https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
7
+ ![brotli](https://img.badgesize.io/https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.js?compression=brotli&style=flat-square&label=brotli)
8
+ ![GitHub latest release](https://img.shields.io/github/v/release/CoCreateJS/render?style=flat-square)
9
+ ![License](https://img.shields.io/github/license/CoCreateJS/render?style=flat-square)
10
10
  ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
11
11
 
12
- ![CoCreate-render](https://cdn.cocreate.app/docs/CoCreate-render.gif)
12
+ ![CoCreate-render](https://cdn.CoCreateJS.com/docs/CoCreate-render.gif)
13
13
 
14
- ## [Docs & Demo](https://cocreate.app/docs/render)
14
+ ## [Docs & Demo](https://CoCreateJS.com/docs/render)
15
15
 
16
- For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/render)
16
+ For a complete guide and working demo refer to the [doumentation](https://CoCreateJS.com/docs/render)
17
17
 
18
18
  ## CDN
19
19
 
20
20
  ```html
21
- <script src="https://cdn.cocreate.app/render/latest/CoCreate-render.min.js"></script>
21
+ <script src="https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.js"></script>
22
22
  ```
23
23
 
24
24
  ```html
25
- <script src="https://cdn.cocreate.app/render/latest/CoCreate-render.min.css"></script>
25
+ <script src="https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.css"></script>
26
26
  ```
27
27
 
28
28
  ## NPM
@@ -50,13 +50,13 @@ $ yarn install @cocreate/render
50
50
 
51
51
  # Announcements
52
52
 
53
- All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-render/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-render/releases). You may also subscribe to email for releases and breaking changes.
53
+ All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreateJS/render/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreateJS/render/releases). You may also subscribe to email for releases and breaking changes.
54
54
 
55
55
  <a name="roadmap"></a>
56
56
 
57
57
  # Roadmap
58
58
 
59
- If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-render/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-render/pulls). We would love to hear your feedback.
59
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreateJS/render/issues) and [pull requests](https://github.com/CoCreateJS/render/pulls). We would love to hear your feedback.
60
60
 
61
61
  <a name="about"></a>
62
62
 
@@ -64,7 +64,7 @@ If you are interested in the future direction of this project, please take a loo
64
64
 
65
65
  CoCreate-render is guided and supported by the CoCreate Developer Experience Team.
66
66
 
67
- Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
67
+ Please Email the Developer Experience Team [here](mailto:develop@CoCreateJS.com) in case of any queries.
68
68
 
69
69
  CoCreate-render is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
70
70
 
@@ -72,9 +72,9 @@ CoCreate-render is maintained and funded by CoCreate. The names and logos for Co
72
72
 
73
73
  # How to Contribute
74
74
 
75
- We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-render/blob/master/CONTRIBUTING.md) guide for details.
75
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreateJS/render/blob/master/CONTRIBUTING.md) guide for details.
76
76
 
77
- We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-render/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-render/pulls) or merely upvote or comment on existing issues or pull requests.
77
+ We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreateJS/render/issues) and [pull requests](https://github.com/CoCreateJS/render/pulls) or merely upvote or comment on existing issues or pull requests.
78
78
 
79
79
  We appreciate your continued support, thank you!
80
80
 
@@ -84,8 +84,38 @@ We appreciate your continued support, thank you!
84
84
 
85
85
  This software is dual-licensed under the GNU Affero General Public License version 3 (AGPLv3) and a commercial license.
86
86
 
87
- - **Open Source Use**: For open-source projects and non-commercial use, this software is available under the AGPLv3. The AGPLv3 allows you to freely use, modify, and distribute this software, provided that all modifications and derivative works are also licensed under the AGPLv3. For the full license text, see the [LICENSE file](https://github.com/CoCreate-app/CoCreate-render/blob/master/LICENSE).
87
+ - **Open Source Use**: For open-source projects and non-commercial use, this software is available under the AGPLv3. The AGPLv3 allows you to freely use, modify, and distribute this software, provided that all modifications and derivative works are also licensed under the AGPLv3. For the full license text, see the [LICENSE file](https://github.com/CoCreateJS/render/blob/master/LICENSE).
88
88
 
89
- - **Commercial Use**: For-profit companies and individuals intending to use this software for commercial purposes must obtain a commercial license. The commercial license is available when you sign up for an API key on our [website](https://cocreate.app). This license permits proprietary use and modification of the software without the copyleft requirements of the AGPLv3. It is ideal for integrating this software into proprietary commercial products and applications.
89
+ - **Commercial Use**: For-profit companies and individuals intending to use this software for commercial purposes must obtain a commercial license. The commercial license is available when you sign up for an API key on our [website](https://CoCreateJS.com). This license permits proprietary use and modification of the software without the copyleft requirements of the AGPLv3. It is ideal for integrating this software into proprietary commercial products and applications.
90
90
 
91
91
  If you have not purchased a commercial license and intend to use this software for commercial purposes, you are required to sign up for an API key on our website.
92
+
93
+
94
+ ## Server
95
+
96
+ Render also provides a stateless server-side HTML renderer. Import it from `@cocreate/render/server`; the browser renderer remains available from `@cocreate/render`.
97
+
98
+ ### Server rendering
99
+
100
+ The `HTML` function processes HTML strings, resolves nested file and database-backed content, applies state and metadata, and protects recursive includes from circular references.
101
+
102
+ ```javascript
103
+ import { HTML } from '@cocreate/render/server';
104
+
105
+ const html = await HTML({
106
+ file: {
107
+ src: `<html><body><h1 array="posts" object="post-id" key="title"></h1></body></html>`,
108
+ pathname: "/pages/dashboard.html",
109
+ organization_id: "organization-id"
110
+ },
111
+ organization: { languages: ["en"] },
112
+ urlObject: new URL("https://example.com/pages/dashboard.html"),
113
+ lang: "en",
114
+ theme: "dark",
115
+ crud: crudInstance
116
+ });
117
+ ```
118
+
119
+ ### Server HTML attributes
120
+
121
+ The server renderer evaluates `src` for nested file fragments, `array` and `object` to resolve records, and `key` to place a value. It also supports `filter`, `value-type="outerHTML"`, `render-error`, `state-id`, and `state-overwrite`. Server rendering marks inserted content with `rendered="true"` so the browser does not fetch the same fragment again.
@@ -44,7 +44,7 @@
44
44
  </pre>
45
45
 
46
46
  <!-- CoCreate JS CDN -->
47
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
48
- <!-- <script src="https://CoCreate.app/dist/CoCreate.js"></script> -->
47
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
48
+ <!-- <script src="https://CoCreateJS.com/dist/CoCreate.js"></script> -->
49
49
  </body>
50
50
  </html>
package/demo/index.html CHANGED
@@ -114,6 +114,6 @@
114
114
  </pre>
115
115
 
116
116
  <!--<script src="../dist/CoCreate-render.js"></script>-->
117
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
117
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
118
118
  </body>
119
119
  </html>
@@ -53,6 +53,6 @@
53
53
  </pre>
54
54
 
55
55
  <!-- CoCreate JS CDN -->
56
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
56
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
57
57
  </body>
58
58
  </html>
package/demo/render.html CHANGED
@@ -43,6 +43,6 @@
43
43
  </pre>
44
44
 
45
45
  <!-- CoCreate JS CDN -->
46
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
46
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
47
47
  </body>
48
48
  </html>
@@ -52,6 +52,6 @@
52
52
  </pre>
53
53
 
54
54
  <!-- CoCreate JS CDN -->
55
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
55
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
56
56
  </body>
57
57
  </html>
@@ -26,6 +26,6 @@
26
26
  </form>
27
27
 
28
28
  <!-- <script src="../dist/CoCreate-render-key.js"></script> -->
29
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
29
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
30
30
  </body>
31
31
  </html>
package/docs/index.html CHANGED
@@ -9,7 +9,7 @@
9
9
  rel="icon"
10
10
  type="image/png"
11
11
  sizes="32x32"
12
- href="https://cocreate.app/images/favicon.ico" />
12
+ href="https://CoCreateJS.com/images/favicon.ico" />
13
13
  <meta
14
14
  name="description"
15
15
  content="A simple yet powerful drag-and-drop solution powered by javascript." />
@@ -19,7 +19,7 @@
19
19
  <meta name="robots" content="index,follow" />
20
20
  <meta
21
21
  property="og:image"
22
- content="https://cdn.cocreate.app/docs/render.png" />
22
+ content="https://cdn.CoCreateJS.com/docs/render.png" />
23
23
 
24
24
  <link
25
25
  rel="stylesheet"
@@ -73,7 +73,7 @@
73
73
  share-title="testing im a title"
74
74
  share-height="600"
75
75
  share-width="700"
76
- share-media="https://cdn.cocreate.app/docs/render.png"
76
+ share-media="https://cdn.CoCreateJS.com/docs/render.png"
77
77
  hover="display:block!important"
78
78
  hover-query=".social-networks">
79
79
  <div class="display:none social-networks">
@@ -104,7 +104,7 @@
104
104
  ></a>
105
105
  </div>
106
106
  <a
107
- href="https://github.com/CoCreate-app/CoCreate-dnd"
107
+ href="https://github.com/CoCreateJS/CoCreate-dnd"
108
108
  target="_blank"
109
109
  class=""
110
110
  ><i src="/assets/svg/github.svg"></i
@@ -141,7 +141,7 @@
141
141
  <p class="padding:10px_0px line-height:1.5">
142
142
  Or you can use cdn link:
143
143
  </p>
144
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/render/latest/CoCreate-render.min.js&lt;/script&gt;</code></pre>
144
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/render/latest/CoCreate-render.min.js&lt;/script&gt;</code></pre>
145
145
  <p class="padding:10px_0px line-height:1.5">
146
146
  for styling please refer to #id-style
147
147
  </p>
@@ -537,13 +537,13 @@
537
537
  </div>
538
538
  </div>
539
539
  <button
540
- href="https://github.com/CoCreate-app/CoCreate-render/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
540
+ href="https://github.com/CoCreateJS/render/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
541
541
  target="_blank"
542
542
  class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
543
543
  <i src="../assets/svg/pencil-alt.svg"></i>
544
544
  </button>
545
545
  </main>
546
546
 
547
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
547
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
548
548
  </body>
549
549
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/render",
3
- "version": "1.53.0",
3
+ "version": "2.0.1",
4
4
  "description": "A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "render",
@@ -22,44 +22,38 @@
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "git+https://gitlab.com/cocreatejs/CoCreate-render.git"
25
+ "url": "git+https://github.com/CoCreateJS/render.git"
26
26
  },
27
27
  "author": "CoCreate LLC",
28
28
  "license": "AGPL-3.0",
29
29
  "bugs": {
30
- "url": "https://github.com/CoCreate-app/CoCreate-render/issues"
30
+ "url": "https://github.com/CoCreateJS/render/issues"
31
31
  },
32
- "homepage": "https://cocreate.app/docs/render",
32
+ "homepage": "https://CoCreateJS.com/docs/render",
33
33
  "funding": {
34
34
  "type": "GitHub Sponsors ❤",
35
- "url": "https://github.com/sponsors/CoCreate-app"
35
+ "url": "https://github.com/sponsors/CoCreateJS"
36
36
  },
37
- "main": "./src/index.js",
37
+ "main": "./src/server/index.js",
38
+ "browser": "./src/client/index.js",
38
39
  "dependencies": {
39
- "@cocreate/actions": "^1.24.0",
40
- "@cocreate/api": "^1.31.0",
41
- "@cocreate/element-prototype": "^1.35.0",
42
- "@cocreate/observer": "^1.23.0",
43
- "@cocreate/utils": "^1.54.0"
40
+ "@cocreate/actions": "^2.0.0",
41
+ "@cocreate/api": "^2.0.0",
42
+ "@cocreate/element-prototype": "^2.0.0",
43
+ "@cocreate/observer": "^2.0.0",
44
+ "@cocreate/utils": "^2.0.0"
44
45
  },
45
46
  "devDependencies": {
46
- "@cocreate/webpack": "^1.9.0"
47
+ "@cocreate/webpack": "^2.0.0"
47
48
  },
48
- "allowScripts": {
49
- "@cocreate/actions@1.21.4": true,
50
- "@cocreate/api@1.22.5": true,
51
- "@cocreate/config@1.13.4": true,
52
- "@cocreate/crud-client@1.34.6": true,
53
- "@cocreate/element-prototype@1.31.4": true,
54
- "@cocreate/elements@1.42.9": true,
55
- "@cocreate/filter@1.33.6": true,
56
- "@cocreate/indexeddb@1.23.4": true,
57
- "@cocreate/local-storage@1.16.5": true,
58
- "@cocreate/observer@1.19.0": true,
59
- "@cocreate/organizations@1.30.1": true,
60
- "@cocreate/render@1.46.1": true,
61
- "@cocreate/socket-client@1.40.5": true,
62
- "@cocreate/utils@1.42.2": true,
63
- "@cocreate/webpack@1.4.3": true
49
+ "exports": {
50
+ ".": {
51
+ "node": "./src/server/index.js",
52
+ "deno": "./src/server/index.js",
53
+ "browser": "./src/client/index.js",
54
+ "default": "./src/server/index.js"
55
+ },
56
+ "./server": "./src/server/index.js",
57
+ "./client": "./src/client/index.js"
64
58
  }
65
59
  }
@@ -0,0 +1,2 @@
1
+ .template, [template] {display: none !important;}
2
+ .render-pending {display: none !important;}