@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotosm/ui",
3
- "version": "0.2.0a4",
3
+ "version": "0.2.0a6",
4
4
  "description": "Shared UI components with theming for use across HOTOSM tools.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -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,6 @@
1
+ import Tracking from '../components/Tracking';
2
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Tracking, {
3
+ onHotAgree: string;
4
+ onHotDisagree: string;
5
+ }>;
6
+ 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;