@hotosm/ui 0.2.0-a4 → 0.2.0-a6
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/components/Tracking.js +7 -1
- package/package.json +1 -1
- package/react/HotToolbar.d.ts +12 -0
- package/react/HotToolbar.js +21 -0
- package/react/HotTracking.d.ts +6 -0
- package/react/HotTracking.js +15 -0
package/components/Tracking.js
CHANGED
|
@@ -78,9 +78,15 @@ export class Tracking extends LitElement {
|
|
|
78
78
|
}
|
|
79
79
|
connectedCallback() {
|
|
80
80
|
super.connectedCallback();
|
|
81
|
+
// Close automatically if already optout
|
|
81
82
|
if (localStorage.getItem(`${this.siteId}-optout-closed`) === 'true') {
|
|
82
|
-
// Close automatically if already optout
|
|
83
83
|
this.isOpen = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Close automatically if wrong domain
|
|
87
|
+
if (window.location.hostname !== this.domain) {
|
|
88
|
+
this.isOpen = false;
|
|
89
|
+
return;
|
|
84
90
|
}
|
|
85
91
|
// Configure Matomo tracking
|
|
86
92
|
const matomoTrackingId = this.siteId;
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Toolbar from '../components/Toolbar';
|
|
2
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Toolbar, {
|
|
3
|
+
onHotUndoClick: string;
|
|
4
|
+
onHotRedoClick: string;
|
|
5
|
+
onHotBoldClick: string;
|
|
6
|
+
onHotItalicClick: string;
|
|
7
|
+
onHotUnderlineClick: string;
|
|
8
|
+
onHotLeftalignClick: string;
|
|
9
|
+
onHotCenteralignClick: string;
|
|
10
|
+
onHotRightalignClick: string;
|
|
11
|
+
}>;
|
|
12
|
+
export default reactWrapper;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createComponent } from '@lit/react';
|
|
4
|
+
import Toolbar from '../components/Toolbar';
|
|
5
|
+
const reactWrapper = createComponent({
|
|
6
|
+
tagName: 'hot-toolbar',
|
|
7
|
+
elementClass: Toolbar,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onHotUndoClick: 'hot-undo-click',
|
|
11
|
+
onHotRedoClick: 'hot-redo-click',
|
|
12
|
+
onHotBoldClick: 'hot-bold-click',
|
|
13
|
+
onHotItalicClick: 'hot-italic-click',
|
|
14
|
+
onHotUnderlineClick: 'hot-underline-click',
|
|
15
|
+
onHotLeftalignClick: 'hot-leftalign-click',
|
|
16
|
+
onHotCenteralignClick: 'hot-centeralign-click',
|
|
17
|
+
onHotRightalignClick: 'hot-rightalign-click',
|
|
18
|
+
},
|
|
19
|
+
displayName: 'hot-toolbar'
|
|
20
|
+
});
|
|
21
|
+
export default reactWrapper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createComponent } from '@lit/react';
|
|
4
|
+
import Tracking from '../components/Tracking';
|
|
5
|
+
const reactWrapper = createComponent({
|
|
6
|
+
tagName: 'hot-tracking',
|
|
7
|
+
elementClass: Tracking,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onHotAgree: 'agree',
|
|
11
|
+
onHotDisagree: 'disagree',
|
|
12
|
+
},
|
|
13
|
+
displayName: 'hot-tracking'
|
|
14
|
+
});
|
|
15
|
+
export default reactWrapper;
|