@cocreate/api 1.10.13 → 1.10.15

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/docs/index.html CHANGED
@@ -1,241 +1,241 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
- <title>CoCreate-api Documentation | CoCreateJS </title>
9
- <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
10
- <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
- <meta name="keywords" content="drag and drop, collaboration, dnd utility, drag and drop utility" />
12
- <meta name="robots" content="index,follow" />
13
- <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
14
-
15
- <!-- CoCreate CSS -->
16
- <link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css" />
17
- <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true" />
18
-
19
- <link rel="manifest" href="/manifest.webmanifest" />
20
- </head>
21
-
22
- <body>
23
- <nav class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav,hide-nav" scroll-up="10" scroll-down="10" collection="files" document_id="60395ef42b3ac232657040fd"
24
- name="src">
25
- </nav>
26
- <sidenav id="menuL" class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl" resizable resize-target="[content_id='content']" resize-property="margin-left" resize-value="width">
27
- <menu collection="files" document_id="603717b07de7fb350ae9fec8" name="src"></menu>
28
- <div resize="right"></div>
29
- </sidenav>
30
- <main class="padding-top:15px padding:15px@lg@xl" content_id="content" id="CoCreate-api">
31
- <div class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px">
32
- <div class="display:flex align-items:center">
33
- <h2>CoCreate-api</h2>
34
- </div>
35
- <div class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
36
- <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="Enter decription here" share-title="testing im a title" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/api.png"
37
- hover="display:block!important" hover-target=".social-networks">
38
- <div class="display:none social-networks">
39
- <a class="margin-right:15px" share-network='twitter' title="Share on twitter"><i class="height:20px fill:#505050" src="/assets/svg/twitter.svg"></i></a>
40
- <a class="margin-right:15px" share-network='facebook' title="Share on Facebook"><i class="height:20px fill:#505050" src="/assets/svg/facebook.svg"></i></a>
41
- <a class="margin-right:15px" share-network='instagram' title="Share on instagram"><i class="height:20px fill:#505050" src="/assets/svg/instagram.svg"></i></a>
42
- </div>
43
- <a class="margin-right:15px" share-network='share' title="Share on share"><i class="height:20px fill:#505050" src="/assets/svg/share-alt.svg"></i></a>
44
- </div>
45
- <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i class="height:20px fill:#505050" src="/assets/svg/github.svg"></i></a>
46
- </div>
47
- </div>
48
- <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">CoCreate-api is a simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. CoCreate-api includes the
49
- client component and server side for api processing.</h1>
50
- <div id="api-section" class="display:flex flex-wrap:wrap">
51
- <div class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
52
-
53
- <div id="api-install" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-install-section">
54
- <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#api-install"]'>
55
- <h2 class="padding:5px_0px">Install</h2>
56
- <a class="margin-left:10px display:none" href="#api-install"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
57
- </span>
58
- </div>
59
-
60
- <pre><code class="language-bash">npm i @cocreate/api</code></pre>
61
- <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
62
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
63
-
64
- <div>
65
- <h2 id="api-dependencies" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">Dependencies components</h2>
66
- <a class="display:none" href="#api-dependencies"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
67
- </div>
68
-
69
- <p class="padding:10px_0px line-height:1.5">
70
- <strong>CoCreate.js</strong>,
71
- <strong>CoCreate-action.js</strong>,
72
- <strong>CoCreate-render.js</strong>,
73
- </p>
74
-
75
-
76
- <div id="api-usage" class="margin-top:80px border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-usage-section">
77
- <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#api-usage"]'>
78
- <h2 class="padding:5px_0px">Usage</h2>
79
- <a class="margin-left:10px display:none" href="#api-usage"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
80
- </span>
81
- </div>
82
-
83
- <h4 class="margin-top:20px padding:5px_0px">Install package</h4>
84
- <p class="padding:10px_0px line-height:1.5">
85
- <pre><code class="language-bash">npm i @cocreate/api</code></pre>
86
- </p>
87
- <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
88
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
89
-
90
- <div>
91
- <h2 id="api-server-run" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">Server run</h2>
92
- <a class="display:none" href="#api-server-run"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
93
- </div>
94
-
95
- <p class="padding:10px_0px line-height:1.5">
96
- <pre><code class="language-javascript">npm run start</code></pre>
97
- <p>Server's default port is 8081.</p>
98
- </p>
99
-
100
- <h4 class="margin-top:20px padding:5px_0px">Client side</h4>
101
- <p class="padding:10px_0px line-height:1.5">
102
- In order to the client to use the local server, it should be set as follows.
103
- <pre><code class="language-javascript">
104
- var CoCreateConfig = {
105
- key: '2061acef-0451-4545-f754-60cf8160',
106
- organization_id: '5ff747727005da1c272740ab',
107
- host: 'localhost:8081'
108
- }
109
- </code></pre>
110
- </p>
111
-
112
- <div>
113
- <h2 id="api-functions" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">CoCreate-api functions</h2>
114
- <a class="display:none" href="#api-functions"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
115
- </div>
116
-
117
- <ul class="list-style-type:none ">
118
- <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
119
- <h4><span>register(module_name, instance)</span><span class="cocreate-badge success">string</span> <span class="cocreate-badge danger">required</span></h4>
120
- <p>The function that register cocreate-api module.</p>
121
- <p class="padding:10px_0px line-height:1.5">
122
- <pre><code class="language-javascript">CoCreateApi.register('stripe', CoCreateStripe)</code></pre>
123
- </p>
124
-
125
- </li>
126
- <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
127
- <h4><span>send(module_name, action_name, data)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge danger">required</span></h4>
128
- <p>The function that send the data into server by module_name and action</p>
129
- <p class="padding:10px_0px line-height:1.5">
130
- <pre><code class="language-javascript">CoCreateApi.send('stripe', 'createCustomer', {
131
- name: 'Name',
132
- email: 'test@gmail.com',
133
- ...
134
- })</code></pre>
135
- </p>
136
- </li>
137
- <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
138
- <h4><span>render(module_name, action_name, data)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge warning">optional</span></h4>
139
- <p>The function to render data into template</p>
140
- <p class="padding:10px_0px line-height:1.5">
141
- <pre><code class="language-javascript">CoCreate.api.render('stripe', 'createCustomer', {name: 'Name', email: 'test@gmail.com', ...})</code></pre>
142
- </p>
143
- </li>
144
- <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
145
- <h4><span>getFormData(moudle_name, action_name, container)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge warning">optional</span></h4>
146
- <p>The function is that get module data from form</p>
147
- <p class="padding:10px_0px line-height:1.5">
148
- <pre><code class="language-javascript">
149
- let container = btn.closest("form") || document;
150
- let data = CoCreateApi.getFormData('stripe', 'createCustomer', container);
151
- CoCreateApi.send(this.id, 'createCustomer', [data]);
152
-
153
- </code></pre>
154
- </p>
155
-
156
- <p>HTML Example</p>
157
- <p class="padding:10px_0px line-height:1.5">
158
- <pre><code class="language-html">
159
- &lt;form&gt;
160
- &lt;input stripe=&quot;createCustomer.name&quot;&gt;
161
- &lt;div stripe=&quot;createCustomer.address&quot; stripe_array=&quot;address&quot;&gt;
162
- &lt;input stripe=&quot;address.home.city&quot;&gt;
163
- &lt;input stripe=&quot;address.work&quot;&gt;
164
- &lt;/div&gt;
165
-
166
- &lt;div stripe=&quot;createCustomer.address&quot; xxx_array=&quot;address&quot;&gt;
167
- &lt;input stripe=&quot;address.home.city&quot;&gt;
168
- &lt;input stripe=&quot;address.name&quot;&gt;
169
- &lt;input stripe=&quot;address.line1&quot;&gt;
170
-
171
- &lt;div stripe=&quot;address.billing&quot; xxx_array=&quot;b&quot;&gt;
172
- &lt;input stripe=&quot;b.address1&quot;&gt;
173
- &lt;input stripe=&quot;b.city&quot;&gt;
174
- &lt;input stripe=&quot;b.code.zip&quot;&gt;
175
- &lt;input stripe=&quot;b.code.postal&quot;&gt;
176
- &lt;/div&gt;
177
- &lt;/div&gt;
178
- &lt;button actions=&#39;createCustomer&#39;&gt;Create Form&lt;/button&gt;
179
- &lt;/form&gt;
180
- </code></pre>
181
- </p>
182
- </li>
183
- </ul>
184
-
185
- <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">How Does It Works</h2>
186
- <p>CoCreate-fetch works based on cocreate.js and template. </p>
187
-
188
- <p>To fetch the array data, the template wrapper should define <code class="language-js">fetch-document</code>. <code class="language-js">template_id</code></p>
189
-
190
- <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">Effects and Styles</h2>
191
-
192
- <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">Events</h2>
193
- <h4><span></span><span class="cocreate-badge success"></span></h4>
194
-
195
- </div>
196
-
197
- <div class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey">
198
-
199
- <!-- SandBox -->
200
- <div id="api-demo" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-demo-section">
201
- <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#api-demo"]'>
202
- <h2 class="padding:5px_0px">Demo</h2>
203
- <a class="margin-left:10px display:none" href="#api-demo"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
204
- </span>
205
- </div>
206
- <div class="position:sticky top:0 padding:15px_0px height:100vh">
207
- <!-- SandBox -->
208
- <div class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
209
-
210
- <div id="demo-code" resizable class="position:relative height:50%">
211
- <textarea type="code" lang="html" collection="demos" document_id="" name="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
212
- <div resize="bottom" class="background:lightgrey"></div>
213
- </div>
214
-
215
- <div id="demo-preview" class="position:relative overflow:auto background-color:white">
216
- <div class="demopreview" class="padding:20px"></div>
217
- </div>
218
-
219
- <div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
220
- <a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="height:18px fill:#505050" src="/assets/svg/eye.svg"></i></a>
221
- <a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="height:20px fill:#505050" src="/assets/svg/eye-slash.svg"></i></a>
222
- <a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="height:20px fill:#505050" src="/assets/svg/code.svg"></i></a>
223
- <a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="display:flex height:18px fill:#505050" src="/assets/svg/code.svg"></i></a>
224
- <a class="margin-right:5px" fullscreen fullscreen-target="#playground"></a>
225
- </div>
226
-
227
- </div>
228
- <!-- End SandBox -->
229
- </div>
230
- </div>
231
- </div>
232
-
233
- <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
234
- <i class="height:20px fill:#505050" src="/assets/svg/pencil-alt.svg"></i>
235
- </button>
236
- </main>
237
- <script src="/apikey.js"></script>
238
- <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
239
- </body>
240
-
241
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <title>CoCreate-api Documentation | CoCreateJS </title>
9
+ <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
10
+ <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
+ <meta name="keywords" content="drag and drop, collaboration, dnd utility, drag and drop utility" />
12
+ <meta name="robots" content="index,follow" />
13
+ <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
14
+
15
+ <!-- CoCreate CSS -->
16
+ <link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css" />
17
+ <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true" />
18
+
19
+ <link rel="manifest" href="/manifest.webmanifest" />
20
+ </head>
21
+
22
+ <body>
23
+ <nav class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav,hide-nav" scroll-up="10" scroll-down="10" collection="files" document_id="60395ef42b3ac232657040fd"
24
+ name="src">
25
+ </nav>
26
+ <sidenav id="menuL" class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl" resizable resize-target="[content_id='content']" resize-property="margin-left" resize-value="width">
27
+ <menu collection="files" document_id="603717b07de7fb350ae9fec8" name="src"></menu>
28
+ <div resize="right"></div>
29
+ </sidenav>
30
+ <main class="padding-top:15px padding:15px@lg@xl" content_id="content" id="CoCreate-api">
31
+ <div class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px">
32
+ <div class="display:flex align-items:center">
33
+ <h2>CoCreate-api</h2>
34
+ </div>
35
+ <div class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
36
+ <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="Enter decription here" share-title="testing im a title" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/api.png"
37
+ hover="display:block!important" hover-target=".social-networks">
38
+ <div class="display:none social-networks">
39
+ <a class="margin-right:15px" share-network="twitter" title="Share on twitter"><i class="height:20px fill:#505050" src="/assets/svg/twitter.svg"></i></a>
40
+ <a class="margin-right:15px" share-network="facebook" title="Share on Facebook"><i class="height:20px fill:#505050" src="/assets/svg/facebook.svg"></i></a>
41
+ <a class="margin-right:15px" share-network="instagram" title="Share on instagram"><i class="height:20px fill:#505050" src="/assets/svg/instagram.svg"></i></a>
42
+ </div>
43
+ <a class="margin-right:15px" share-network="share" title="Share on share"><i class="height:20px fill:#505050" src="/assets/svg/share-alt.svg"></i></a>
44
+ </div>
45
+ <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i class="height:20px fill:#505050" src="/assets/svg/github.svg"></i></a>
46
+ </div>
47
+ </div>
48
+ <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">CoCreate-api is a simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. CoCreate-api includes the
49
+ client component and server side for api processing.</h1>
50
+ <div id="api-section" class="display:flex flex-wrap:wrap">
51
+ <div class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
52
+
53
+ <div id="api-install" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-install-section">
54
+ <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target="[href='#api-install']">
55
+ <h2 class="padding:5px_0px">Install</h2>
56
+ <a class="margin-left:10px display:none" href="#api-install"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
57
+ </span>
58
+ </div>
59
+
60
+ <pre><code class="language-bash">npm i @cocreate/api</code></pre>
61
+ <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
62
+ <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
63
+
64
+ <div>
65
+ <h2 id="api-dependencies" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">Dependencies components</h2>
66
+ <a class="display:none" href="#api-dependencies"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
67
+ </div>
68
+
69
+ <p class="padding:10px_0px line-height:1.5">
70
+ <strong>CoCreate.js</strong>,
71
+ <strong>CoCreate-action.js</strong>,
72
+ <strong>CoCreate-render.js</strong>,
73
+ </p>
74
+
75
+
76
+ <div id="api-usage" class="margin-top:80px border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-usage-section">
77
+ <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target="[href='#api-usage']">
78
+ <h2 class="padding:5px_0px">Usage</h2>
79
+ <a class="margin-left:10px display:none" href="#api-usage"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
80
+ </span>
81
+ </div>
82
+
83
+ <h4 class="margin-top:20px padding:5px_0px">Install package</h4>
84
+ <p class="padding:10px_0px line-height:1.5">
85
+ <pre><code class="language-bash">npm i @cocreate/api</code></pre>
86
+ </p>
87
+ <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
88
+ <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
89
+
90
+ <div>
91
+ <h2 id="api-server-run" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">Server run</h2>
92
+ <a class="display:none" href="#api-server-run"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
93
+ </div>
94
+
95
+ <p class="padding:10px_0px line-height:1.5">
96
+ <pre><code class="language-javascript">npm run start</code></pre>
97
+ <p>Server's default port is 8081.</p>
98
+ </p>
99
+
100
+ <h4 class="margin-top:20px padding:5px_0px">Client side</h4>
101
+ <p class="padding:10px_0px line-height:1.5">
102
+ In order to the client to use the local server, it should be set as follows.
103
+ <pre><code class="language-javascript">
104
+ var CoCreateConfig = {
105
+ key: '2061acef-0451-4545-f754-60cf8160',
106
+ organization_id: '5ff747727005da1c272740ab',
107
+ host: 'localhost:8081'
108
+ }
109
+ </code></pre>
110
+ </p>
111
+
112
+ <div>
113
+ <h2 id="api-functions" hover="display:block" hover-target="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">CoCreate-api functions</h2>
114
+ <a class="display:none" href="#api-functions"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
115
+ </div>
116
+
117
+ <ul class="list-style-type:none ">
118
+ <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
119
+ <h4><span>register(module_name, instance)</span><span class="cocreate-badge success">string</span> <span class="cocreate-badge danger">required</span></h4>
120
+ <p>The function that register cocreate-api module.</p>
121
+ <p class="padding:10px_0px line-height:1.5">
122
+ <pre><code class="language-javascript">CoCreateApi.register('stripe', CoCreateStripe)</code></pre>
123
+ </p>
124
+
125
+ </li>
126
+ <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
127
+ <h4><span>send(module_name, action_name, data)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge danger">required</span></h4>
128
+ <p>The function that send the data into server by module_name and action</p>
129
+ <p class="padding:10px_0px line-height:1.5">
130
+ <pre><code class="language-javascript">CoCreateApi.send('stripe', 'createCustomer', {
131
+ name: 'Name',
132
+ email: 'test@gmail.com',
133
+ ...
134
+ })</code></pre>
135
+ </p>
136
+ </li>
137
+ <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
138
+ <h4><span>render(module_name, action_name, data)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge warning">optional</span></h4>
139
+ <p>The function to render data into template</p>
140
+ <p class="padding:10px_0px line-height:1.5">
141
+ <pre><code class="language-javascript">CoCreate.api.render('stripe', 'createCustomer', {name: 'Name', email: 'test@gmail.com', ...})</code></pre>
142
+ </p>
143
+ </li>
144
+ <li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
145
+ <h4><span>getFormData(moudle_name, action_name, container)</span> <span class="cocreate-badge success">string</span> <span class="cocreate-badge warning">optional</span></h4>
146
+ <p>The function is that get module data from form</p>
147
+ <p class="padding:10px_0px line-height:1.5">
148
+ <pre><code class="language-javascript">
149
+ let container = btn.closest("form") || document;
150
+ let data = CoCreateApi.getFormData('stripe', 'createCustomer', container);
151
+ CoCreateApi.send(this.id, 'createCustomer', [data]);
152
+
153
+ </code></pre>
154
+ </p>
155
+
156
+ <p>HTML Example</p>
157
+ <p class="padding:10px_0px line-height:1.5">
158
+ <pre><code class="language-html">
159
+ &lt;form&gt;
160
+ &lt;input stripe=&quot;createCustomer.name&quot;&gt;
161
+ &lt;div stripe=&quot;createCustomer.address&quot; stripe_array=&quot;address&quot;&gt;
162
+ &lt;input stripe=&quot;address.home.city&quot;&gt;
163
+ &lt;input stripe=&quot;address.work&quot;&gt;
164
+ &lt;/div&gt;
165
+
166
+ &lt;div stripe=&quot;createCustomer.address&quot; xxx_array=&quot;address&quot;&gt;
167
+ &lt;input stripe=&quot;address.home.city&quot;&gt;
168
+ &lt;input stripe=&quot;address.name&quot;&gt;
169
+ &lt;input stripe=&quot;address.line1&quot;&gt;
170
+
171
+ &lt;div stripe=&quot;address.billing&quot; xxx_array=&quot;b&quot;&gt;
172
+ &lt;input stripe=&quot;b.address1&quot;&gt;
173
+ &lt;input stripe=&quot;b.city&quot;&gt;
174
+ &lt;input stripe=&quot;b.code.zip&quot;&gt;
175
+ &lt;input stripe=&quot;b.code.postal&quot;&gt;
176
+ &lt;/div&gt;
177
+ &lt;/div&gt;
178
+ &lt;button actions=&#39;createCustomer&#39;&gt;Create Form&lt;/button&gt;
179
+ &lt;/form&gt;
180
+ </code></pre>
181
+ </p>
182
+ </li>
183
+ </ul>
184
+
185
+ <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">How Does It Works</h2>
186
+ <p>CoCreate-fetch works based on cocreate.js and template. </p>
187
+
188
+ <p>To fetch the array data, the template wrapper should define <code class="language-js">fetch-document</code>. <code class="language-js">template_id</code></p>
189
+
190
+ <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">Effects and Styles</h2>
191
+
192
+ <h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">Events</h2>
193
+ <h4><span></span><span class="cocreate-badge success"></span></h4>
194
+
195
+ </div>
196
+
197
+ <div class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey">
198
+
199
+ <!-- SandBox -->
200
+ <div id="api-demo" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#api-demo-section">
201
+ <span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target="[href='#api-demo']">
202
+ <h2 class="padding:5px_0px">Demo</h2>
203
+ <a class="margin-left:10px display:none" href="#api-demo"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
204
+ </span>
205
+ </div>
206
+ <div class="position:sticky top:0 padding:15px_0px height:100vh">
207
+ <!-- SandBox -->
208
+ <div class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
209
+
210
+ <div id="demo-code" resizable class="position:relative height:50%">
211
+ <textarea type="code" lang="html" collection="demos" document_id="" name="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
212
+ <div resize="bottom" class="background:lightgrey"></div>
213
+ </div>
214
+
215
+ <div id="demo-preview" class="position:relative overflow:auto background-color:white">
216
+ <div class="demopreview padding:20px"></div>
217
+ </div>
218
+
219
+ <div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
220
+ <a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="height:18px fill:#505050" src="/assets/svg/eye.svg"></i></a>
221
+ <a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="height:20px fill:#505050" src="/assets/svg/eye-slash.svg"></i></a>
222
+ <a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="height:20px fill:#505050" src="/assets/svg/code.svg"></i></a>
223
+ <a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="display:flex height:18px fill:#505050" src="/assets/svg/code.svg"></i></a>
224
+ <a class="margin-right:5px" fullscreen fullscreen-target="#playground"></a>
225
+ </div>
226
+
227
+ </div>
228
+ <!-- End SandBox -->
229
+ </div>
230
+ </div>
231
+ </div>
232
+
233
+ <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
234
+ <i class="height:20px fill:#505050" src="/assets/svg/pencil-alt.svg"></i>
235
+ </button>
236
+ </main>
237
+ <script src="/apikey.js"></script>
238
+ <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
239
+ </body>
240
+
241
+ </html>