json-object-editor 0.10.440 → 0.10.444

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 (60) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build.js +61 -0
  3. package/css/jif/Read Me.txt +5 -5
  4. package/css/jif/demo-files/demo.css +153 -153
  5. package/css/jif/demo-files/demo.js +30 -30
  6. package/css/jif/demo.html +285 -285
  7. package/css/jif/fonts/joeiconfont.svg +24 -24
  8. package/css/jif/ie7/ie7.css +45 -45
  9. package/css/jif/ie7/ie7.js +46 -46
  10. package/css/jif/selection.json +573 -573
  11. package/css/joe.css +15 -9
  12. package/css/joe.min.css +7 -0
  13. package/css/jquery-ui-1.10.4.custom.min.css +5 -5
  14. package/css/jquery-ui.min.css +6 -6
  15. package/css/jquery.timepicker.css +72 -72
  16. package/es5-build/web-components/account-info.js +136 -136
  17. package/es5-build/web-components/capp-components.js +160 -160
  18. package/es5-build/web-components/capp-panel.js +85 -85
  19. package/es5-build/web-components/capp-view.js +73 -73
  20. package/es5-build/web-components/joe-autocomplete.js +149 -149
  21. package/es5-build/web-components/joe-button.js +132 -132
  22. package/es5-build/web-components/joe-card.js +92 -92
  23. package/es5-build/web-components/joe-component.js +74 -74
  24. package/es5-build/web-components/joe-field.js +70 -70
  25. package/es5-build/web-components/joe-list-item.js +176 -176
  26. package/es5-build/web-components/joe-user-cube.js +100 -100
  27. package/es5-build/web-components/report-components.js +133 -133
  28. package/grunt/build +86 -86
  29. package/grunt/package-lock.json +9105 -9105
  30. package/grunt/package.json +47 -47
  31. package/grunt/src +86 -86
  32. package/js/joe.js +12 -8
  33. package/js/joe.min.js +1 -15
  34. package/js/leaflet.js +8 -8
  35. package/js/libs/adapter-latest.js +4400 -4400
  36. package/js/libs/craydent-1.9.2.js +11741 -11741
  37. package/js/libs/craydent-upload-2.0.0.js +394 -394
  38. package/js/libs/hammer.min.208.js +6 -6
  39. package/js/libs/jquery-3.5.1.min.js +2 -2
  40. package/js/libs/moment.min.js +6 -6
  41. package/js/native-shim.js +46 -46
  42. package/js/plugins/c3/c3.min.js +5 -5
  43. package/js/plugins/c3/d3.v3.min.js +4 -4
  44. package/js/plugins/threejs/Detector.js +78 -78
  45. package/js/plugins/threejs/LICENSE +21 -21
  46. package/js/plugins/threejs/MTLLoader.js +417 -417
  47. package/js/plugins/threejs/OBJLoader.js +564 -564
  48. package/js/plugins/threejs/OrbitControls.js +1037 -1037
  49. package/js/plugins/threejs/README.md +9 -9
  50. package/js/plugins/threejs/assets/female-croupier-2013-03-26.mtl +3 -3
  51. package/js/plugins/threejs/index.html +178 -178
  52. package/js/plugins/threejs/three.js +41507 -41507
  53. package/package.json +9 -4
  54. package/server/fields/core.js +1 -1
  55. package/server/modules/Server.js +21 -1
  56. package/server/plugins/chatgpt-assistants.js +359 -359
  57. package/server/plugins/chatgpt-tools.js +79 -79
  58. package/server/plugins/engagementTracker.js +78 -0
  59. package/server/schemas/engagement_event.js +33 -0
  60. package/server/schemas/page.js +18 -1
@@ -1,79 +1,79 @@
1
- const OpenAI = require("openai");
2
-
3
- function ChatGPTTools() {
4
- const self = this;
5
-
6
- function coloredLog(message) {
7
- console.log(JOE.Utils.color('[chatgpt-tools]', 'plugin', false), message);
8
- }
9
-
10
-
11
-
12
- function getAPIKey() {
13
- const setting = JOE.Utils.Settings('OPENAI_API_KEY');
14
- if (!setting) throw new Error("Missing OPENAI_API_KEY setting");
15
- return setting;
16
- }
17
-
18
- //search JOE data for ai_tool objects
19
- function getTools(data){
20
- var query = Object.assign({itemtype:'ai_tool'}, data||{});
21
- var tools = JOE.Cache.search(query);
22
- var functionalTools = {};
23
- for(var i=0; i<tools.length; i++){
24
- var tool = tools[i];
25
- functionalTools[tool._id] = Object.assign(tool,{
26
- tool_properties:JSON.parse(tool.tool_properties),
27
- });
28
- }
29
- return functionalTools;
30
- }
31
-
32
- function newClient() {
33
- return new OpenAI({ apiKey: getAPIKey() });
34
- }
35
-
36
-
37
- this.default = function(data, req, res) {
38
- try {
39
- var payload = {
40
- params: req.params,
41
- data: data,
42
- tools:getTools(data),
43
- success:true
44
- };
45
- } catch (e) {
46
- return { errors: 'plugin error: ' + e, failedat: 'plugin' };
47
- }
48
- return payload;
49
- };
50
-
51
- this.flattened = function(data, req, res){
52
- try {
53
- var flattened = JOE.Utils.flattenObject(data._id);
54
- var payload = {
55
- params: req.params,
56
- data: data,
57
- object:flattened,
58
- success:true
59
- };
60
- } catch (e) {
61
- return { errors: 'plugin error: ' + e, failedat: 'plugin' };
62
- }
63
- return payload;
64
- }
65
- //1. start or continue a conversation
66
-
67
-
68
-
69
-
70
- //self.profileBusinessFromURL = profileBusinessFromURL;
71
- this.async = {
72
-
73
-
74
- };
75
- return self;
76
-
77
- }
78
-
79
- module.exports = new ChatGPTTools();
1
+ const OpenAI = require("openai");
2
+
3
+ function ChatGPTTools() {
4
+ const self = this;
5
+
6
+ function coloredLog(message) {
7
+ console.log(JOE.Utils.color('[chatgpt-tools]', 'plugin', false), message);
8
+ }
9
+
10
+
11
+
12
+ function getAPIKey() {
13
+ const setting = JOE.Utils.Settings('OPENAI_API_KEY');
14
+ if (!setting) throw new Error("Missing OPENAI_API_KEY setting");
15
+ return setting;
16
+ }
17
+
18
+ //search JOE data for ai_tool objects
19
+ function getTools(data){
20
+ var query = Object.assign({itemtype:'ai_tool'}, data||{});
21
+ var tools = JOE.Cache.search(query);
22
+ var functionalTools = {};
23
+ for(var i=0; i<tools.length; i++){
24
+ var tool = tools[i];
25
+ functionalTools[tool._id] = Object.assign(tool,{
26
+ tool_properties:JSON.parse(tool.tool_properties),
27
+ });
28
+ }
29
+ return functionalTools;
30
+ }
31
+
32
+ function newClient() {
33
+ return new OpenAI({ apiKey: getAPIKey() });
34
+ }
35
+
36
+
37
+ this.default = function(data, req, res) {
38
+ try {
39
+ var payload = {
40
+ params: req.params,
41
+ data: data,
42
+ tools:getTools(data),
43
+ success:true
44
+ };
45
+ } catch (e) {
46
+ return { errors: 'plugin error: ' + e, failedat: 'plugin' };
47
+ }
48
+ return payload;
49
+ };
50
+
51
+ this.flattened = function(data, req, res){
52
+ try {
53
+ var flattened = JOE.Utils.flattenObject(data._id);
54
+ var payload = {
55
+ params: req.params,
56
+ data: data,
57
+ object:flattened,
58
+ success:true
59
+ };
60
+ } catch (e) {
61
+ return { errors: 'plugin error: ' + e, failedat: 'plugin' };
62
+ }
63
+ return payload;
64
+ }
65
+ //1. start or continue a conversation
66
+
67
+
68
+
69
+
70
+ //self.profileBusinessFromURL = profileBusinessFromURL;
71
+ this.async = {
72
+
73
+
74
+ };
75
+ return self;
76
+
77
+ }
78
+
79
+ module.exports = new ChatGPTTools();
@@ -0,0 +1,78 @@
1
+ function EngagementTracker() {
2
+ const self = this;
3
+
4
+ // 📸 Email open pixel endpoint
5
+ // Called as: /API/plugin/engagementTracker/pixel?campaign=...&visitor=...
6
+ this.pixel = async function(data, req, res) {
7
+ const campaign_id = req.query.campaign;
8
+ const visitor = req.query.visitor;
9
+
10
+ if (!campaign_id) return res.status(400).send({ error: "Missing campaign ID" });
11
+
12
+ const engagement = {
13
+ _id: cuid(),
14
+ itemtype: "engagement_event",
15
+ eventType: "email_open",
16
+ eventTarget: "email",
17
+ eventLabel: "Email opened",
18
+ campaign: campaign_id,
19
+ visitor: visitor || "anonymous",
20
+ eventLocation: "email",
21
+ created: new Date()
22
+ };
23
+
24
+ await JOE.Storage.save(engagement, "engagement_event");
25
+
26
+ // Transparent 1x1 gif
27
+ const img = Buffer.from("R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==", "base64");
28
+ res.writeHead(200, {
29
+ "Content-Type": "image/gif",
30
+ "Content-Length": img.length
31
+ });
32
+ return res.end(img);
33
+ };
34
+
35
+ // 🔗 Click-through tracking + redirect
36
+ // Called as: /API/plugin/engagementTracker/redirect?campaign=...&to=URL&target=cta_1&visitor=...
37
+ this.redirect = async function(data, req, res) {
38
+ const { campaign, to, target, visitor } = req.query;
39
+ if (!to || !campaign) return res.status(400).send({ error: "Missing required parameters" });
40
+
41
+ const engagement = {
42
+ _id: cuid(),
43
+ itemtype: "engagement_event",
44
+ eventType: "click_cta",
45
+ eventTarget: target || "unspecified",
46
+ eventLabel: `Clicked ${target || "link"}`,
47
+ campaign,
48
+ visitor: visitor || "anonymous",
49
+ eventLocation: "email_or_landing",
50
+ created: new Date()
51
+ };
52
+
53
+ await JOE.Storage.save(engagement, "engagement_event");
54
+ return res.redirect(to);
55
+ };
56
+
57
+ // ✍️ Generic event logger
58
+ // Called via POST to /API/plugin/engagementTracker/log with JSON body
59
+ this.log = async function(data, req, res) {
60
+ if (!data || !data.eventType || !data.campaign) {
61
+ return res.status(400).send({ error: "Missing eventType or campaign" });
62
+ }
63
+
64
+ const engagement = {
65
+ ...data,
66
+ _id: cuid(),
67
+ itemtype: "engagement_event",
68
+ created: new Date()
69
+ };
70
+
71
+ await JOE.Storage.save(engagement, "engagement_event");
72
+ return res.send({ status: "ok" });
73
+ };
74
+
75
+ return self;
76
+ }
77
+
78
+ module.exports = new EngagementTracker();
@@ -0,0 +1,33 @@
1
+ var schema = {
2
+ title: "Engagement Event | ${eventType}",
3
+ info: "Tracks visitor interactions across email campaigns, landing pages, and CTAs for analytics and engagement insight.",
4
+ menuicon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path d="..."/></svg>`, // optional: stylized icon
5
+ idprop: "_id",
6
+ sorter: ["-created", "eventType", "eventTarget"],
7
+ listView: {
8
+ title: "<joe-title>${eventType}</joe-title><joe-subtitle>${eventLabel}</joe-subtitle><joe-subtitle>${visitor}</joe-subtitle>",
9
+ listWindowTitle: "Engagement Events"
10
+ },
11
+ fields: function(){
12
+ var fields = [
13
+
14
+ {section_start:'objects'},
15
+ { name: "campaign", type: "objectReference", ref: "campaign", label: "Campaign" },
16
+ {section_end:'objects'},
17
+ { name: "eventType", type: "select", options: ["email_open", "email_click", "landing_visit", "click_cta", "form_submit"], required: true },
18
+ { name: "eventTarget", type: "text", label: "Target Element", placeholder: "e.g. CTA 1, Header Link" },
19
+ { name: "name", type: "text", label: "Event Label", placeholder: "Descriptive text of action" },
20
+ { name: "eventLocation", type: "select", options: ["email", "landingPage", "external"], label: "Location" },
21
+ { name: "visitor", type: "text", label: "Visitor ID or Email" },
22
+ { name: "session", type: "text", label: "Session ID" },
23
+
24
+ {section_start:'system',collapsed:true},
25
+ '_id','created','itemtype',
26
+ {section_end:'system'},
27
+ ]
28
+
29
+ return fields;
30
+ }
31
+ };
32
+
33
+ module.exports = schema;
@@ -96,9 +96,26 @@ var page = {
96
96
  hidden:function(item){
97
97
  return item.content_type =='plugin';
98
98
  },
99
+ language:function(item){
100
+ return 'javascript';
101
+ },
99
102
  comment:'${this.DATA.dataset_name}<br/>'+
100
103
  `also available: INCLUDES,PAGE,LAYOUT,SITE,JOEPATH,DATA,WEBCONFIG
101
- <div>for module: export function(data) that returns an html string.</div>`,
104
+ <div>for module: export function(data) that returns an html string.</div>
105
+
106
+
107
+ <h4>Example:</h4>
108
+ <div class="pad10">
109
+ <pre>
110
+ module.exports = async function(data){
111
+ // data contains all the page data, including dynamic items
112
+ return "html as string";
113
+
114
+ };
115
+ </pre>
116
+ </div>
117
+ </div>`
118
+ ,
102
119
  type:function(item){
103
120
  if(!item.content_type){
104
121
  return 'code';