@ohbug/extension-feedback 0.3.0 → 0.5.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/LICENSE +6 -6
- package/README.md +3 -4
- package/dist/Box.d.ts +4 -0
- package/dist/Box.d.ts.map +1 -0
- package/dist/Selector.d.ts +4 -0
- package/dist/Selector.d.ts.map +1 -0
- package/dist/{src/assets.d.ts → assets.d.ts} +1 -1
- package/dist/assets.d.ts.map +1 -0
- package/dist/{src/env.d.ts → env.d.ts} +0 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +519 -0
- package/dist/index.mjs +5852 -0
- package/dist/store.d.ts +9 -0
- package/dist/{src/store.d.ts.map → store.d.ts.map} +1 -1
- package/package.json +23 -48
- package/dist/extension.es.js +0 -34
- package/dist/extension.umd.js +0 -34
- package/dist/src/Box.d.ts +0 -4
- package/dist/src/Box.d.ts.map +0 -1
- package/dist/src/Selector.d.ts +0 -4
- package/dist/src/Selector.d.ts.map +0 -1
- package/dist/src/assets.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/store.d.ts +0 -9
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const store: {
|
|
2
|
+
working: boolean;
|
|
3
|
+
selectedElement: HTMLElement | null;
|
|
4
|
+
}, setStore: import("solid-js/store").SetStoreFunction<{
|
|
5
|
+
working: boolean;
|
|
6
|
+
selectedElement: HTMLElement | null;
|
|
7
|
+
}>;
|
|
8
|
+
export { store, setStore };
|
|
9
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["store.ts"],"names":[],"mappings":"AAEA,QAAA,MAAO,KAAK;aACD,OAAO;qBACC,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["store.ts"],"names":[],"mappings":"AAEA,QAAA,MAAO,KAAK;aACD,OAAO;qBACC,WAAW,GAAG,IAAI;GAFvB,QAAQ;aACX,OAAO;qBACC,WAAW,GAAG,IAAI;EACQ,CAAA;AAE7C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,74 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ohbug": {
|
|
3
|
-
"name": "OhbugExtensionFeedback",
|
|
4
|
-
"key": "feedback"
|
|
5
|
-
},
|
|
6
2
|
"name": "@ohbug/extension-feedback",
|
|
7
|
-
"version": "0.
|
|
8
|
-
"description": "
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Ohbug extension to collect user feedback",
|
|
5
|
+
"license": "MIT",
|
|
9
6
|
"author": "chenyueban <jasonchan0527@gmail.com>",
|
|
10
|
-
"homepage": "https://github.com/ohbug-org/
|
|
7
|
+
"homepage": "https://github.com/ohbug-org/extensions",
|
|
11
8
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/ohbug-org/
|
|
9
|
+
"url": "https://github.com/ohbug-org/extensions/issues"
|
|
13
10
|
},
|
|
14
11
|
"repository": {
|
|
15
12
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/ohbug-org/
|
|
13
|
+
"url": "https://github.com/ohbug-org/extensions"
|
|
17
14
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"unpkg": "./dist/extension.es.js",
|
|
22
|
-
"jsdelivr": "./dist/extension.es.js",
|
|
23
|
-
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"module": "dist/index.mjs",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
24
18
|
"exports": {
|
|
25
19
|
".": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
20
|
+
"require": "./dist/index.js",
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
28
23
|
}
|
|
29
24
|
},
|
|
30
25
|
"files": [
|
|
31
26
|
"dist"
|
|
32
27
|
],
|
|
33
28
|
"dependencies": {
|
|
34
|
-
"@ohbug/
|
|
35
|
-
"@ohbug/utils": "^
|
|
36
|
-
"
|
|
29
|
+
"@ohbug/types": "^2.1.1",
|
|
30
|
+
"@ohbug/utils": "^2.0.6",
|
|
31
|
+
"html2canvas": "^1.4.1",
|
|
32
|
+
"solid-js": "^1.4.8"
|
|
37
33
|
},
|
|
38
34
|
"devDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"commitizen": "^4.2.4",
|
|
45
|
-
"cssnano": "^5.0.8",
|
|
46
|
-
"cz-conventional-changelog": "3.3.0",
|
|
47
|
-
"postcss": "^8.3.6",
|
|
48
|
-
"release-it": "^14.11.5",
|
|
49
|
-
"rimraf": "^3.0.2",
|
|
50
|
-
"tailwindcss": "^2.2.15",
|
|
51
|
-
"typescript": "^4.4.2",
|
|
52
|
-
"vite": "^2.5.7",
|
|
53
|
-
"vite-dts": "^1.0.3",
|
|
54
|
-
"vite-plugin-dts": "^0.8.0",
|
|
55
|
-
"vite-plugin-solid": "^2.0.3"
|
|
35
|
+
"vite": "^3.0.4",
|
|
36
|
+
"vite-plugin-dts": "^1.4.1",
|
|
37
|
+
"vite-plugin-solid": "^2.3.0",
|
|
38
|
+
"vite-plugin-windicss": "^1.8.7",
|
|
39
|
+
"windicss": "^3.5.6"
|
|
56
40
|
},
|
|
57
41
|
"publishConfig": {
|
|
58
42
|
"access": "public"
|
|
59
43
|
},
|
|
60
44
|
"scripts": {
|
|
61
45
|
"prebuild": "rimraf dist",
|
|
62
|
-
"dev": "vite build -w",
|
|
63
46
|
"build": "vite build",
|
|
64
|
-
"
|
|
65
|
-
"play": "npm -C playground run dev",
|
|
66
|
-
"release": "npm run build && release-it",
|
|
67
|
-
"commit": "cz"
|
|
68
|
-
},
|
|
69
|
-
"config": {
|
|
70
|
-
"commitizen": {
|
|
71
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
72
|
-
}
|
|
47
|
+
"dev": "vite build -w"
|
|
73
48
|
}
|
|
74
|
-
}
|
|
49
|
+
}
|
package/dist/extension.es.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const e=Symbol("solid-proxy"),t={equals:(e,t)=>e===t};let n=O;const o={},r={owned:null,cleanups:null,context:null,owner:null};var i=null;let s=null,l=null,u=null,c=null,a=0;function d(e,n){n=n?Object.assign({},t,n):t;const r={value:e,observers:null,observerSlots:null,pending:o,comparator:n.equals||void 0};return[y.bind(r),e=>("function"==typeof e&&(e=e(r.pending!==o?r.pending:r.value)),m(r,e))]}function f(e,t,n){w(x(e,t,!1,1))}function h(e,t,o){n=S;const r=x(e,t,!1,1);r.user=!0,c&&c.push(r)}function p(e,n,r){r=r?Object.assign({},t,r):t;const i=x(e,n,!0,0);return i.pending=o,i.observers=null,i.observerSlots=null,i.comparator=r.equals||void 0,w(i),y.bind(i)}function g(e){if(l)return e();let t;const n=l=[];try{t=e()}finally{l=null}return $((()=>{for(let e=0;e<n.length;e+=1){const t=n[e];if(t.pending!==o){const e=t.pending;t.pending=o,m(t,e)}}}),!1),t}function b(e){let t,n=s;return s=null,t=e(),s=n,t}function v(){return s}function y(){if(this.state&&this.sources){const e=u;u=null,1===this.state?w(this):E(this),u=e}if(s){const e=this.observers?this.observers.length:0;s.sources?(s.sources.push(this),s.sourceSlots.push(e)):(s.sources=[this],s.sourceSlots=[e]),this.observers?(this.observers.push(s),this.observerSlots.push(s.sources.length-1)):(this.observers=[s],this.observerSlots=[s.sources.length-1])}return this.value}function m(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(l)return e.pending===o&&l.push(e),e.pending=t,t;let r=!1;return e.value=t,e.observers&&e.observers.length&&$((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];r,n.pure?u.push(n):c.push(n),n.observers&&!n.state&&k(n),n.state=1}if(u.length>1e6)throw u=[],new Error}),!1),t}function w(e){if(!e.fn)return;A(e);const t=i,n=s,o=a;s=i=e,function(e,t,n){let o;try{o=e.fn(t)}catch(r){N(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?m(e,o):e.value=o,e.updatedAt=n)}(e,e.value,o),s=n,i=t}function x(e,t,n,o=1,s){const l={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:i,context:null,pure:n};return null===i||i!==r&&(i.owned?i.owned.push(l):i.owned=[l]),l}function _(e){if(1!==e.state)return e.state=0;if(e.suspense&&b(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<a);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(1===(e=t[n]).state)w(e);else if(2===e.state){const t=u;u=null,E(e),u=t}}function $(e,t){if(u)return e();let o=!1;t||(u=[]),c?o=!0:c=[],a++;try{e()}catch(r){N(r)}finally{!function(e){u&&(O(u),u=null);if(e)return;c.length?g((()=>{n(c),c=null})):c=null}(o)}}function O(e){for(let t=0;t<e.length;t++)_(e[t])}function S(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:_(o)}const o=e.length;for(t=0;t<n;t++)_(e[t]);for(t=o;t<e.length;t++)_(e[t])}function E(e){e.state=0;for(let t=0;t<e.sources.length;t+=1){const n=e.sources[t];n.sources&&(1===n.state?_(n):2===n.state&&E(n))}}function k(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=2,n.pure?u.push(n):c.push(n),n.observers&&k(n))}}function A(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),o=t.observers;if(o&&o.length){const e=o.pop(),r=t.observerSlots.pop();n<o.length&&(e.sourceSlots[r]=n,o[n]=e,t.observerSlots[n]=r)}}if(e.owned){for(t=0;t<e.owned.length;t++)A(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function N(e){throw e}function j(e,t){return b((()=>e(t)))}function C(e){let t=!1;const n=p((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return p((()=>{const o=n();if(o){const n=e.children;return(t="function"==typeof n&&n.length>0)?b((()=>n(o))):n}return e.fallback}))}function z(e,t,n){let o=n.length,r=t.length,i=o,s=0,l=0,u=t[r-1].nextSibling,c=null;for(;s<r||l<i;)if(t[s]!==n[l]){for(;t[r-1]===n[i-1];)r--,i--;if(r===s){const t=i<o?l?n[l-1].nextSibling:n[i-l]:u;for(;l<i;)e.insertBefore(n[l++],t)}else if(i===l)for(;s<r;)c&&c.has(t[s])||e.removeChild(t[s]),s++;else if(t[s]===n[i-1]&&n[l]===t[r-1]){const o=t[--r].nextSibling;e.insertBefore(n[l++],t[s++].nextSibling),e.insertBefore(n[--i],o),t[r]=n[i]}else{if(!c){c=new Map;let e=l;for(;e<i;)c.set(n[e],e++)}const o=c.get(t[s]);if(null!=o)if(l<o&&o<i){let u,a=s,d=1;for(;++a<r&&a<i&&null!=(u=c.get(t[a]))&&u===o+d;)d++;if(d>o-l){const r=t[s];for(;l<o;)e.insertBefore(n[l++],r)}else e.replaceChild(n[l++],t[s++])}else s++;else e.removeChild(t[s++])}}else s++,l++}function T(e,t,n){let o;return function(e,t){t&&(i=t);const n=s,o=i,l=0===e.length?r:{owned:null,cleanups:null,context:null,owner:o};let u;i=l,s=null;try{$((()=>u=e((()=>A(l)))),!0)}finally{s=n,i=o}}((r=>{o=r,H(t,e(),t.firstChild?null:void 0,n)})),()=>{o(),t.textContent=""}}function D(e,t,n){const o=document.createElement("template");o.innerHTML=e;let r=o.content.firstChild;return n&&(r=r.firstChild),r}function P(e,t=window.document){const n=t._$DX_DELEGATE||(t._$DX_DELEGATE=new Set);for(let o=0,r=e.length;o<r;o++){const r=e[o];n.has(r)||(n.add(r),t.addEventListener(r,M))}}function H(e,t,n,o){if(void 0===n||o||(o=[]),"function"!=typeof t)return B(e,t,o,n);f((o=>B(e,t(),o,n)),o)}function M(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n});null!==n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(void 0!==r?o(r,e):o(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function B(e,t,n,o,r){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,s=void 0!==o;if(e=s&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i)if("number"===i&&(t=t.toString()),s){let r=n[0];r&&3===r.nodeType?r.data=t:r=document.createTextNode(t),n=F(e,n,o,r)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===i)n=F(e,n,o);else{if("function"===i)return f((()=>{let r=t();for(;"function"==typeof r;)r=r();n=B(e,r,n,o)})),()=>n;if(Array.isArray(t)){const i=[];if(L(i,t,r))return f((()=>n=B(e,i,n,o,!0))),()=>n;if(0===i.length){if(n=F(e,n,o),s)return n}else Array.isArray(n)?0===n.length?V(e,i,o):z(e,n,i):null==n||""===n?V(e,i):z(e,s&&n||[e.firstChild],i);n=i}else if(t instanceof Node){if(Array.isArray(n)){if(s)return n=F(e,n,o,t);F(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function L(e,t,n){let o=!1;for(let r=0,i=t.length;r<i;r++){let i,s=t[r];if(s instanceof Node)e.push(s);else if(null==s||!0===s||!1===s);else if(Array.isArray(s))o=L(e,s)||o;else if("string"==(i=typeof s))e.push(document.createTextNode(s));else if("function"===i)if(n){for(;"function"==typeof s;)s=s();o=L(e,Array.isArray(s)?s:[s])||o}else e.push(s),o=!0;else e.push(document.createTextNode(s.toString()))}return o}function V(e,t,n){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function F(e,t,n,o){if(void 0===n)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){const s=t[i];if(r!==s){const t=s.parentNode===e;o||i?t&&e.removeChild(s):t?e.replaceChild(r,s):e.insertBefore(r,n)}else o=!0}}else e.insertBefore(r,n);return[r]}var U=function(){return(U=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function q(e){return"string"==typeof e}var K=function(e,t,n,o){this.type=n,this.timestamp=o||(new Date).toISOString(),this.message=e,this.data=t};!function(){function e(e,t){var n=e.apiKey,o=e.appVersion,r=e.appType,i=e.releaseStage,s=e.timestamp,l=e.category,u=e.type,c=e.sdk,a=e.detail,d=e.device,f=e.user,h=e.actions,p=e.metaData;this.apiKey=n,this.appVersion=o,this.appType=r,this.releaseStage=i,this.timestamp=s,this.category=l,this.type=u,this.sdk=c,this.detail=a,this.device=d,this.user=f,this.actions=h,this.metaData=p,this._client=t}Object.defineProperty(e.prototype,"_isOhbugEvent",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.addAction=function(e,t,n,o){var r,i,s=this.actions,l=q(e)?e:"",u=t||{},c=q(n)?n:"",a=new K(l,u,c,o);s.length>=(null!==(i=null===(r=this._client)||void 0===r?void 0:r._config.maxActions)&&void 0!==i?i:30)&&s.shift(),s.push(a)},e.prototype.getUser=function(){return this.user},e.prototype.setUser=function(e){var t,n,o;if(n=e,"[object Object]"===Object.prototype.toString.call(n)&&Object.keys(e).length<=6)return this.user=U(U({},this.user),e),this.getUser();null===(t=this._client)||void 0===t||t._logger.warn((o=e,new Error("Invalid data\n- "+"setUser should be an object and have up to 6 attributes"+", got "+JSON.stringify(o))))},e.prototype.addMetaData=function(e,t){return function(e,t,n){t&&(e[t]=n)}(this.metaData,e,t)},e.prototype.getMetaData=function(e){return function(e,t){if(e[t])return e[t]}(this.metaData,e)},e.prototype.deleteMetaData=function(e){return function(e,t){if(e[t])return delete e[t]}(this.metaData,e)},e.prototype.toJSON=function(){var e=this;return{apiKey:e.apiKey,appVersion:e.appVersion,appType:e.appType,timestamp:e.timestamp,category:e.category,type:e.type,sdk:e.sdk,device:e.device,detail:e.detail,user:e.user,actions:e.actions,metaData:e.metaData,releaseStage:e.releaseStage}}}();var R={};function G(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:R;
|
|
16
|
-
/*! *****************************************************************************
|
|
17
|
-
Copyright (c) Microsoft Corporation.
|
|
18
|
-
|
|
19
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
-
purpose with or without fee is hereby granted.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */
|
|
30
|
-
return function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`Ohbug warning(condition, format, ...args)` requires a warning message argument");if(!e){var r=0,i=t.replace(/%s/g,(function(){return n[r++]}));throw new Error("Ohbug "+i)}}(Boolean(e.__OHBUG__),"Failed to get `OhbugObject`, please confirm if `Ohbug.init`"),e.__OHBUG__}function X(e,t){e.parentNode&&(t.push(e.parentNode),X(e.parentNode,t))}function I(e){var t=[];return t.push(e),X(e,t),t}const J=Symbol("store-raw"),Y=Symbol("store-node"),Q=Symbol("store-name");function W(t,n){let o=t[e];if(!o){Object.defineProperty(t,e,{value:o=new Proxy(t,oe)});const n=Object.keys(t),r=Object.getOwnPropertyDescriptors(t);for(let e=0,i=n.length;e<i;e++){const i=n[e];if(r[i].get){const e=r[i].get.bind(o);Object.defineProperty(t,i,{get:e})}}}return o}function Z(e){return null!=e&&"object"==typeof e&&(!e.__proto__||e.__proto__===Object.prototype||Array.isArray(e))}function ee(e,t=new Set){let n,o,r,i;if(n=null!=e&&e[J])return n;if(!Z(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)r=e[n],(o=ee(r,t))!==r&&(e[n]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=n.length;l<u;l++)i=n[l],s[i].get||(r=e[i],(o=ee(r,t))!==r&&(e[i]=o))}return e}function te(e){let t=e[Y];return t||Object.defineProperty(e,Y,{value:t={}}),t}function ne(){const[e,t]=d(void 0,{equals:!1,internal:!0});return e.$=t,e}const oe={get(t,n,o){if(n===J)return t;if(n===e)return o;const r=t[n];if(n===Y||"__proto__"===n)return r;const i=Z(r);if(v()&&("function"!=typeof r||t.hasOwnProperty(n))){let e,o;i&&(e=te(r))&&(o=e._||(e._=ne()),o()),e=te(t),o=e[n]||(e[n]=ne()),o()}return i?W(r):r},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){if(v()){const t=te(e);(t._||(t._=ne()))()}return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,n){const o=Reflect.getOwnPropertyDescriptor(t,n);return!o||o.get||n===e||n===Y||n===Q||(delete o.value,delete o.writable,o.get=()=>t[e][n]),o}};function re(e,t,n){if(e[t]===n)return;const o=Array.isArray(e),r=e.length,i=void 0===n,s=o||i===t in e;i?delete e[t]:e[t]=n;let l,u=te(e);(l=u[t])&&l.$(),o&&e.length!==r&&(l=u.length)&&l.$(l,void 0),s&&(l=u._)&&l.$(l,void 0)}function ie(e,t,n=[]){let o,r=e;if(t.length>1){o=t.shift();const i=typeof o,s=Array.isArray(e);if(Array.isArray(o)){for(let r=0;r<o.length;r++)ie(e,[o[r]].concat(t),[o[r]].concat(n));return}if(s&&"function"===i){for(let r=0;r<e.length;r++)o(e[r],r)&&ie(e,[r].concat(t),[r].concat(n));return}if(s&&"object"===i){const{from:r=0,to:i=e.length-1,by:s=1}=o;for(let o=r;o<=i;o+=s)ie(e,[o].concat(t),[o].concat(n));return}if(t.length>1)return void ie(e[o],t,[o].concat(n));r=e[o],n=[o].concat(n)}let i=t[0];"function"==typeof i&&(i=i(r,n),i===r)||void 0===o&&null==i||(i=ee(i),void 0===o||Z(r)&&Z(i)&&!Array.isArray(i)?function(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const r=n[o];re(e,r,t[r])}}(r,i):re(e,o,i))}const[se,le]=function(e,t){const n=ee(e||{});return[W(n),function(...e){g((()=>ie(n,e)))}]}({working:!1,selectedElement:null}),ue=D('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" data-ohbug-selector><path fill="none" d="M0 0h24v24H0z" data-ohbug-selector></path><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" fill="rgba(255,255,255,1)" data-ohbug-selector></path></svg>'),ce=D('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" data-ohbug-selector><path fill="none" d="M0 0h24v24H0z" data-ohbug-selector></path><path d="M3 3h2v2H3V3zm4 0h2v2H7V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm0 4h2v2h-2V7zM3 19h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V7zm7.667 4l1.036-1.555A1 1 0 0 1 12.535 9h2.93a1 1 0 0 1 .832.445L17.333 11H20a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h2.667zM9 19h10v-6h-2.737l-1.333-2h-1.86l-1.333 2H9v6zm5-1a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" data-ohbug-selector></path></svg>'),ae=()=>ue.cloneNode(!0),de=()=>(()=>{const e=ce.cloneNode(!0);return e.firstChild.nextSibling.style.setProperty("fill","var(--color)"),e})();const fe=D('<div class="fixed z-10 top-0 right-0 bottom-0 left-0 bg-none transition border-4 border-blue-500 border-solid pointer-events-none" data-ohbug-selector><div class="tips" data-ohbug-selector>在页面中选取元素<button class="stop-btn" type="button"></button></div></div>'),he=D('<button class="bg-red-500 cursor-pointer rounded-full w-6 h-6 flex items-center justify-center absolute -top-3 -right-3 z-10 pointer-events-auto" type="button" data-ohbug-selector></button>'),pe=D('<button class="bg-red-500 text-white font-semibold cursor-pointer border-4 border-red-500 border-solid absolute right-0 -bottom-full pointer-events-auto" type="button" data-ohbug-selector>Change</button>'),ge=D('<div class="fixed -z-1" data-ohbug-selector><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div data-ohbug-selector></div></div>'),be=()=>{const[e,t]=d();let n,o,r,s,l;function u(e){var t;le({working:!0});const i=document.elementFromPoint(e.clientX,e.clientY);if(void 0!==(null==(t=null==i?void 0:i.dataset)?void 0:t.ohbugSelector))return!1;!function(e){if(!e)return;const{width:t,height:i,top:u,right:c,bottom:a,left:d}=e.getBoundingClientRect();null==l||l.setAttribute("style",`\n width: ${t+4}px;\n height: ${i+4}px;\n top: ${u-2}px;\n left: ${d-2}px;\n `),null==n||n.setAttribute("style",`\n height: ${u}px;\n top: 0;\n right: 0;\n left: 0;\n `),null==o||o.setAttribute("style",`\n top: ${u}px;\n right: 0;\n bottom: 0;\n left: ${c}px;\n `),null==r||r.setAttribute("style",`\n width: ${t+d}px;\n top: ${a}px;\n bottom: 0;\n left: 0;\n `),null==s||s.setAttribute("style",`\n width: ${d}px;\n height: ${i}px;\n top: ${u}px;\n left: 0;\n `)}(i)}function c(){document.addEventListener("mousemove",u)}function a(){document.removeEventListener("mousemove",u)}function p(n){var o;const r=document.elementFromPoint(n.clientX,n.clientY);return void 0===(null==(o=null==r?void 0:r.dataset)?void 0:o.ohbugSelector)&&((!se.selectedElement||!se.working)&&(t(r),function(e){if(!e)return;const{width:t,height:n,top:o,left:r}=e.getBoundingClientRect();le({selectedElement:e}),null==l||l.setAttribute("style",`\n width: ${t+4}px;\n height: ${n+4}px;\n top: ${o-2}px;\n left: ${r-2}px;\n `)}(e()),void a()))}function g(){document.removeEventListener("mousedown",p)}function b(){t(null),a(),g(),le({working:!1,selectedElement:null})}function v(){le({working:!0,selectedElement:null}),t(null),c()}var y;return h((()=>{se.working?(c(),document.addEventListener("mousedown",p)):(a(),g())})),y=b,null===i||(null===i.cleanups?i.cleanups=[y]:i.cleanups.push(y)),(()=>{const t=ge.cloneNode(!0),i=t.firstChild,u=i.nextSibling,c=u.nextSibling,a=c.nextSibling,d=a.nextSibling;return H(t,j(C,{get when(){return!se.selectedElement&&se.working},get children(){const e=fe.cloneNode(!0),t=e.firstChild.firstChild.nextSibling;return t.$$click=b,H(t,j(ae,{})),e}}),i),n=i,(e=>{o=e})(u),(e=>{r=e})(c),(e=>{s=e})(a),(e=>{l=e})(d),H(d,j(C,{get when(){return se.selectedElement&&se.working},get children(){return[(()=>{const e=he.cloneNode(!0);return e.$$click=b,H(e,j(ae,{})),e})(),(()=>{const e=pe.cloneNode(!0);return e.$$click=v,e.style.setProperty("transform","translate(4px, -8px)"),e})()]}})),f((()=>d.className="fixed -z-1 bg-black bg-opacity-20 border-4 rounded-sm transition cursor-pointer box-border pointer-events-none "+(e()?"border-red-500 border-solid":"border-blue-500 border-dashed"))),t})()};P(["click"]);const ve=D('<button class="main-btn" type="button" data-ohbug-selector></button>'),ye=D('<div class="w-80 h-60 fixed z-max right-8 bottom-20 shadow bg-white flex flex-col" data-ohbug-selector><div class="bg-gray-300 p-4" data-ohbug-selector><textarea class="bg-transparent outline-none resize-none w-full" placeholder="告诉我你的感受..." rows="4" maxlength="1000" autofocus data-ohbug-selector></textarea><button class="cursor-pointer" type="button" data-ohbug-selector></button></div><div class="flex justify-between items-center flex-1 p-4" data-ohbug-selector><span class="text-sm" data-ohbug-selector>试试<a class="underline" href="https://ohbug.net" target="_blank" rel="noreferrer" data-ohbug-selector>Ohbug</a>?</span><button class="send-btn" type="button" data-ohbug-selector></button></div><button class="bg-blue-500 cursor-pointer rounded-full w-6 h-6 flex items-center justify-center absolute -top-2 -right-2 z-10" type="button" data-ohbug-selector></button></div>'),me=D('<div class="relative z-max" data-ohbug-selector><div></div></div>'),we=()=>{const[e,t]=d(!1),[n,o]=d("");function r(){le({working:!0})}const[i,s]=d(!1);async function l(){s(!0);const e={target:se.selectedElement};let r,i;se.selectedElement&&(r=function(e){for(var t=e.target||e.srcElement,n=e.target||e.srcElement,o=[],r=0;n&&n.nodeType===Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_TYPE_NODE;n=n.previousSibling)r&&o.push(n),r+=1;var i=void 0===e.path?I(e.target):e.path,s=t.outerHTML;return i.reverse().map((function(e){return(e.localName||"")+(e.id?"#"+e.id:"")+(e.className?"."+e.className:"")+(e.outerHTML===s?":nth-child("+o.length+")":"")})).filter((function(e){return Boolean(e)})).join(" > ")}(e),i=se.selectedElement.outerHTML);const l=G().client,u=l.createEvent({category:"feedback",type:"feedback",detail:{selector:r,outerHTML:i,feedback:n()}});await l.notify(u),t(!1),o(""),le({working:!1,selectedElement:null}),s(!1)}return h((()=>{!1===se.working&&null===se.selectedElement||se.working&&!se.selectedElement?t(!1):t(!0)})),(()=>{const s=me.cloneNode(!0),u=s.firstChild;return H(s,j(C,{get when(){return se.working},get children(){return j(be,{})}}),u),H(u,j(C,{get when(){return!(se.working&&!se.selectedElement)},get children(){const n=ve.cloneNode(!0);return n.$$click=()=>t((e=>!e)),H(n,(()=>e()?"😆":"🙂")),n}}),null),H(u,j(C,{get when(){return e()},get children(){const e=ye.cloneNode(!0),s=e.firstChild,u=s.firstChild,c=u.nextSibling,a=s.nextSibling,d=a.firstChild.nextSibling,h=a.nextSibling;return u.$$input=e=>o(e.target.value),c.$$click=r,H(c,j(de,{})),d.$$click=l,H(d,(()=>i()?"Sending...":"Send")),h.$$click=()=>t((e=>!e)),H(h,j(ae,{})),f((e=>{const t=n(),o=se.selectedElement?"blue":"gray",r=!n()||i();return t!==e._v$&&(u.value=e._v$=t),o!==e._v$2&&c.style.setProperty("--color",e._v$2=o),r!==e._v$3&&(d.disabled=e._v$3=r),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}}),null),s})()};P(["click","input"]);const xe={name:"OhbugExtensionFeedback",init:()=>{const e=document.createElement("div");e.id="OhbugExtensionFeedback-ROOT",document.body.appendChild(e),T((()=>j(we,{})),e)}};function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`/*! tailwindcss v2.2.15 | MIT License | https://tailwindcss.com*//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:-moz-focusring{outline:auto}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-border-opacity:1;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;border-color:rgba(229,231,235,var(--tw-border-opacity))}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.right-8{right:2rem}.bottom-20{bottom:5rem}.-top-2{top:-.5rem}.-right-2{right:-.5rem}.top-0{top:0}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.-top-3{top:-.75rem}.-right-3{right:-.75rem}.-bottom-full{bottom:-100%}.z-max{z-index:2147483640}.z-10{z-index:10}.-z-1{z-index:-1}.box-border{box-sizing:border-box}.flex{display:flex}.h-60{height:15rem}.h-6{height:1.5rem}.w-80{width:20rem}.w-full{width:100%}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.transform{transform:var(--tw-transform)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-full{border-radius:9999px}.rounded-sm{border-radius:.125rem}.border-4{border-width:4px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgba(209,213,219,var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity))}.bg-opacity-40{--tw-bg-opacity:0.4}.bg-opacity-20{--tw-bg-opacity:0.2}.bg-none{background-image:none}.p-4{padding:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.underline{text-decoration:underline}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
31
|
-
.send-btn{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-radius:.125rem;color:rgba(255,255,255,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem;padding:.25rem .75rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.send-btn:disabled{cursor:not-allowed;opacity:.5}
|
|
32
|
-
.main-btn{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06);align-items:center;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-radius:.25rem;bottom:2rem;color:rgba(255,255,255,var(--tw-text-opacity));cursor:pointer;display:flex;height:2rem;justify-content:center;position:fixed;right:2rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:2.5rem;z-index:2147483640}.main-btn,.main-btn:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.main-btn:hover{--tw-bg-opacity:1;--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);background-color:rgba(37,99,235,var(--tw-bg-opacity))}
|
|
33
|
-
.stop-btn{margin-left:.25rem;pointer-events:auto;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.stop-btn:hover{--tw-bg-opacity:1;--tw-bg-opacity:0.3;background-color:rgba(107,114,128,var(--tw-bg-opacity))}
|
|
34
|
-
.tips{--tw-translate-x:-50%;--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;color:rgba(255,255,255,var(--tw-text-opacity));display:flex;font-size:.875rem;left:50%;line-height:1.25rem;padding:.75rem;position:fixed;top:0;transform:var(--tw-transform);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2147483640}`);export{xe as default};
|
package/dist/extension.umd.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).OhbugExtensionFeedback=t()}(this,(function(){"use strict";const e=Symbol("solid-proxy"),t={equals:(e,t)=>e===t};let n=O;const o={},r={owned:null,cleanups:null,context:null,owner:null};var i=null;let s=null,l=null,u=null,c=null,a=0;function d(e,n){n=n?Object.assign({},t,n):t;const r={value:e,observers:null,observerSlots:null,pending:o,comparator:n.equals||void 0};return[y.bind(r),e=>("function"==typeof e&&(e=e(r.pending!==o?r.pending:r.value)),m(r,e))]}function f(e,t,n){w(x(e,t,!1,1))}function h(e,t,o){n=S;const r=x(e,t,!1,1);r.user=!0,c&&c.push(r)}function p(e,n,r){r=r?Object.assign({},t,r):t;const i=x(e,n,!0,0);return i.pending=o,i.observers=null,i.observerSlots=null,i.comparator=r.equals||void 0,w(i),y.bind(i)}function g(e){if(l)return e();let t;const n=l=[];try{t=e()}finally{l=null}return _((()=>{for(let e=0;e<n.length;e+=1){const t=n[e];if(t.pending!==o){const e=t.pending;t.pending=o,m(t,e)}}}),!1),t}function b(e){let t,n=s;return s=null,t=e(),s=n,t}function v(){return s}function y(){if(this.state&&this.sources){const e=u;u=null,1===this.state?w(this):k(this),u=e}if(s){const e=this.observers?this.observers.length:0;s.sources?(s.sources.push(this),s.sourceSlots.push(e)):(s.sources=[this],s.sourceSlots=[e]),this.observers?(this.observers.push(s),this.observerSlots.push(s.sources.length-1)):(this.observers=[s],this.observerSlots=[s.sources.length-1])}return this.value}function m(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(l)return e.pending===o&&l.push(e),e.pending=t,t;let r=!1;return e.value=t,e.observers&&e.observers.length&&_((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];r,n.pure?u.push(n):c.push(n),n.observers&&!n.state&&E(n),n.state=1}if(u.length>1e6)throw u=[],new Error}),!1),t}function w(e){if(!e.fn)return;A(e);const t=i,n=s,o=a;s=i=e,function(e,t,n){let o;try{o=e.fn(t)}catch(r){N(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?m(e,o):e.value=o,e.updatedAt=n)}(e,e.value,o),s=n,i=t}function x(e,t,n,o=1,s){const l={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:i,context:null,pure:n};return null===i||i!==r&&(i.owned?i.owned.push(l):i.owned=[l]),l}function $(e){if(1!==e.state)return e.state=0;if(e.suspense&&b(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<a);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(1===(e=t[n]).state)w(e);else if(2===e.state){const t=u;u=null,k(e),u=t}}function _(e,t){if(u)return e();let o=!1;t||(u=[]),c?o=!0:c=[],a++;try{e()}catch(r){N(r)}finally{!function(e){u&&(O(u),u=null);if(e)return;c.length?g((()=>{n(c),c=null})):c=null}(o)}}function O(e){for(let t=0;t<e.length;t++)$(e[t])}function S(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:$(o)}const o=e.length;for(t=0;t<n;t++)$(e[t]);for(t=o;t<e.length;t++)$(e[t])}function k(e){e.state=0;for(let t=0;t<e.sources.length;t+=1){const n=e.sources[t];n.sources&&(1===n.state?$(n):2===n.state&&k(n))}}function E(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=2,n.pure?u.push(n):c.push(n),n.observers&&E(n))}}function A(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),o=t.observers;if(o&&o.length){const e=o.pop(),r=t.observerSlots.pop();n<o.length&&(e.sourceSlots[r]=n,o[n]=e,t.observerSlots[n]=r)}}if(e.owned){for(t=0;t<e.owned.length;t++)A(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function N(e){throw e}function j(e,t){return b((()=>e(t)))}function C(e){let t=!1;const n=p((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return p((()=>{const o=n();if(o){const n=e.children;return(t="function"==typeof n&&n.length>0)?b((()=>n(o))):n}return e.fallback}))}function z(e,t,n){let o=n.length,r=t.length,i=o,s=0,l=0,u=t[r-1].nextSibling,c=null;for(;s<r||l<i;)if(t[s]!==n[l]){for(;t[r-1]===n[i-1];)r--,i--;if(r===s){const t=i<o?l?n[l-1].nextSibling:n[i-l]:u;for(;l<i;)e.insertBefore(n[l++],t)}else if(i===l)for(;s<r;)c&&c.has(t[s])||e.removeChild(t[s]),s++;else if(t[s]===n[i-1]&&n[l]===t[r-1]){const o=t[--r].nextSibling;e.insertBefore(n[l++],t[s++].nextSibling),e.insertBefore(n[--i],o),t[r]=n[i]}else{if(!c){c=new Map;let e=l;for(;e<i;)c.set(n[e],e++)}const o=c.get(t[s]);if(null!=o)if(l<o&&o<i){let u,a=s,d=1;for(;++a<r&&a<i&&null!=(u=c.get(t[a]))&&u===o+d;)d++;if(d>o-l){const r=t[s];for(;l<o;)e.insertBefore(n[l++],r)}else e.replaceChild(n[l++],t[s++])}else s++;else e.removeChild(t[s++])}}else s++,l++}const T="_$DX_DELEGATE";function P(e,t,n){let o;return function(e,t){t&&(i=t);const n=s,o=i,l=0===e.length?r:{owned:null,cleanups:null,context:null,owner:o};let u;i=l,s=null;try{_((()=>u=e((()=>A(l)))),!0)}finally{s=n,i=o}}((r=>{o=r,M(t,e(),t.firstChild?null:void 0,n)})),()=>{o(),t.textContent=""}}function D(e,t,n){const o=document.createElement("template");o.innerHTML=e;let r=o.content.firstChild;return n&&(r=r.firstChild),r}function H(e,t=window.document){const n=t[T]||(t[T]=new Set);for(let o=0,r=e.length;o<r;o++){const r=e[o];n.has(r)||(n.add(r),t.addEventListener(r,B))}}function M(e,t,n,o){if(void 0===n||o||(o=[]),"function"!=typeof t)return L(e,t,o,n);f((o=>L(e,t(),o,n)),o)}function B(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n});null!==n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(void 0!==r?o(r,e):o(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function L(e,t,n,o,r){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,s=void 0!==o;if(e=s&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i)if("number"===i&&(t=t.toString()),s){let r=n[0];r&&3===r.nodeType?r.data=t:r=document.createTextNode(t),n=U(e,n,o,r)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===i)n=U(e,n,o);else{if("function"===i)return f((()=>{let r=t();for(;"function"==typeof r;)r=r();n=L(e,r,n,o)})),()=>n;if(Array.isArray(t)){const i=[];if(V(i,t,r))return f((()=>n=L(e,i,n,o,!0))),()=>n;if(0===i.length){if(n=U(e,n,o),s)return n}else Array.isArray(n)?0===n.length?F(e,i,o):z(e,n,i):null==n||""===n?F(e,i):z(e,s&&n||[e.firstChild],i);n=i}else if(t instanceof Node){if(Array.isArray(n)){if(s)return n=U(e,n,o,t);U(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function V(e,t,n){let o=!1;for(let r=0,i=t.length;r<i;r++){let i,s=t[r];if(s instanceof Node)e.push(s);else if(null==s||!0===s||!1===s);else if(Array.isArray(s))o=V(e,s)||o;else if("string"==(i=typeof s))e.push(document.createTextNode(s));else if("function"===i)if(n){for(;"function"==typeof s;)s=s();o=V(e,Array.isArray(s)?s:[s])||o}else e.push(s),o=!0;else e.push(document.createTextNode(s.toString()))}return o}function F(e,t,n){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function U(e,t,n,o){if(void 0===n)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){const s=t[i];if(r!==s){const t=s.parentNode===e;o||i?t&&e.removeChild(s):t?e.replaceChild(r,s):e.insertBefore(r,n)}else o=!0}}else e.insertBefore(r,n);return[r]}var q=function(){return(q=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function K(e){return"string"==typeof e}var R=function(e,t,n,o){this.type=n,this.timestamp=o||(new Date).toISOString(),this.message=e,this.data=t};!function(){function e(e,t){var n=e.apiKey,o=e.appVersion,r=e.appType,i=e.releaseStage,s=e.timestamp,l=e.category,u=e.type,c=e.sdk,a=e.detail,d=e.device,f=e.user,h=e.actions,p=e.metaData;this.apiKey=n,this.appVersion=o,this.appType=r,this.releaseStage=i,this.timestamp=s,this.category=l,this.type=u,this.sdk=c,this.detail=a,this.device=d,this.user=f,this.actions=h,this.metaData=p,this._client=t}Object.defineProperty(e.prototype,"_isOhbugEvent",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.addAction=function(e,t,n,o){var r,i,s=this.actions,l=K(e)?e:"",u=t||{},c=K(n)?n:"",a=new R(l,u,c,o);s.length>=(null!==(i=null===(r=this._client)||void 0===r?void 0:r._config.maxActions)&&void 0!==i?i:30)&&s.shift(),s.push(a)},e.prototype.getUser=function(){return this.user},e.prototype.setUser=function(e){var t,n,o;if(n=e,"[object Object]"===Object.prototype.toString.call(n)&&Object.keys(e).length<=6)return this.user=q(q({},this.user),e),this.getUser();null===(t=this._client)||void 0===t||t._logger.warn((o=e,new Error("Invalid data\n- "+"setUser should be an object and have up to 6 attributes"+", got "+JSON.stringify(o))))},e.prototype.addMetaData=function(e,t){return function(e,t,n){t&&(e[t]=n)}(this.metaData,e,t)},e.prototype.getMetaData=function(e){return function(e,t){if(e[t])return e[t]}(this.metaData,e)},e.prototype.deleteMetaData=function(e){return function(e,t){if(e[t])return delete e[t]}(this.metaData,e)},e.prototype.toJSON=function(){var e=this;return{apiKey:e.apiKey,appVersion:e.appVersion,appType:e.appType,timestamp:e.timestamp,category:e.category,type:e.type,sdk:e.sdk,device:e.device,detail:e.detail,user:e.user,actions:e.actions,metaData:e.metaData,releaseStage:e.releaseStage}}}();var G={};function I(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:G;
|
|
16
|
-
/*! *****************************************************************************
|
|
17
|
-
Copyright (c) Microsoft Corporation.
|
|
18
|
-
|
|
19
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
-
purpose with or without fee is hereby granted.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */
|
|
30
|
-
return function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`Ohbug warning(condition, format, ...args)` requires a warning message argument");if(!e){var r=0,i=t.replace(/%s/g,(function(){return n[r++]}));throw new Error("Ohbug "+i)}}(Boolean(e.__OHBUG__),"Failed to get `OhbugObject`, please confirm if `Ohbug.init`"),e.__OHBUG__}function J(e,t){e.parentNode&&(t.push(e.parentNode),J(e.parentNode,t))}function X(e){var t=[];return t.push(e),J(e,t),t}const Y=Symbol("store-raw"),Q=Symbol("store-node"),W=Symbol("store-name");function Z(t,n){let o=t[e];if(!o){Object.defineProperty(t,e,{value:o=new Proxy(t,re)});const n=Object.keys(t),r=Object.getOwnPropertyDescriptors(t);for(let e=0,i=n.length;e<i;e++){const i=n[e];if(r[i].get){const e=r[i].get.bind(o);Object.defineProperty(t,i,{get:e})}}}return o}function ee(e){return null!=e&&"object"==typeof e&&(!e.__proto__||e.__proto__===Object.prototype||Array.isArray(e))}function te(e,t=new Set){let n,o,r,i;if(n=null!=e&&e[Y])return n;if(!ee(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)r=e[n],(o=te(r,t))!==r&&(e[n]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=n.length;l<u;l++)i=n[l],s[i].get||(r=e[i],(o=te(r,t))!==r&&(e[i]=o))}return e}function ne(e){let t=e[Q];return t||Object.defineProperty(e,Q,{value:t={}}),t}function oe(){const[e,t]=d(void 0,{equals:!1,internal:!0});return e.$=t,e}const re={get(t,n,o){if(n===Y)return t;if(n===e)return o;const r=t[n];if(n===Q||"__proto__"===n)return r;const i=ee(r);if(v()&&("function"!=typeof r||t.hasOwnProperty(n))){let e,o;i&&(e=ne(r))&&(o=e._||(e._=oe()),o()),e=ne(t),o=e[n]||(e[n]=oe()),o()}return i?Z(r):r},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){if(v()){const t=ne(e);(t._||(t._=oe()))()}return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,n){const o=Reflect.getOwnPropertyDescriptor(t,n);return!o||o.get||n===e||n===Q||n===W||(delete o.value,delete o.writable,o.get=()=>t[e][n]),o}};function ie(e,t,n){if(e[t]===n)return;const o=Array.isArray(e),r=e.length,i=void 0===n,s=o||i===t in e;i?delete e[t]:e[t]=n;let l,u=ne(e);(l=u[t])&&l.$(),o&&e.length!==r&&(l=u.length)&&l.$(l,void 0),s&&(l=u._)&&l.$(l,void 0)}function se(e,t,n=[]){let o,r=e;if(t.length>1){o=t.shift();const i=typeof o,s=Array.isArray(e);if(Array.isArray(o)){for(let r=0;r<o.length;r++)se(e,[o[r]].concat(t),[o[r]].concat(n));return}if(s&&"function"===i){for(let r=0;r<e.length;r++)o(e[r],r)&&se(e,[r].concat(t),[r].concat(n));return}if(s&&"object"===i){const{from:r=0,to:i=e.length-1,by:s=1}=o;for(let o=r;o<=i;o+=s)se(e,[o].concat(t),[o].concat(n));return}if(t.length>1)return void se(e[o],t,[o].concat(n));r=e[o],n=[o].concat(n)}let i=t[0];"function"==typeof i&&(i=i(r,n),i===r)||void 0===o&&null==i||(i=te(i),void 0===o||ee(r)&&ee(i)&&!Array.isArray(i)?function(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const r=n[o];ie(e,r,t[r])}}(r,i):ie(e,o,i))}const[le,ue]=function(e,t){const n=te(e||{});return[Z(n),function(...e){g((()=>se(n,e)))}]}({working:!1,selectedElement:null}),ce=D('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" data-ohbug-selector><path fill="none" d="M0 0h24v24H0z" data-ohbug-selector></path><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" fill="rgba(255,255,255,1)" data-ohbug-selector></path></svg>'),ae=D('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" data-ohbug-selector><path fill="none" d="M0 0h24v24H0z" data-ohbug-selector></path><path d="M3 3h2v2H3V3zm4 0h2v2H7V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm0 4h2v2h-2V7zM3 19h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V7zm7.667 4l1.036-1.555A1 1 0 0 1 12.535 9h2.93a1 1 0 0 1 .832.445L17.333 11H20a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h2.667zM9 19h10v-6h-2.737l-1.333-2h-1.86l-1.333 2H9v6zm5-1a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" data-ohbug-selector></path></svg>'),de=()=>ce.cloneNode(!0),fe=()=>(()=>{const e=ae.cloneNode(!0);return e.firstChild.nextSibling.style.setProperty("fill","var(--color)"),e})();const he=D('<div class="fixed z-10 top-0 right-0 bottom-0 left-0 bg-none transition border-4 border-blue-500 border-solid pointer-events-none" data-ohbug-selector><div class="tips" data-ohbug-selector>在页面中选取元素<button class="stop-btn" type="button"></button></div></div>'),pe=D('<button class="bg-red-500 cursor-pointer rounded-full w-6 h-6 flex items-center justify-center absolute -top-3 -right-3 z-10 pointer-events-auto" type="button" data-ohbug-selector></button>'),ge=D('<button class="bg-red-500 text-white font-semibold cursor-pointer border-4 border-red-500 border-solid absolute right-0 -bottom-full pointer-events-auto" type="button" data-ohbug-selector>Change</button>'),be=D('<div class="fixed -z-1" data-ohbug-selector><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div class="fixed -z-1 bg-black bg-opacity-40 transition pointer-events-none" data-ohbug-selector></div><div data-ohbug-selector></div></div>'),ve=()=>{const[e,t]=d();let n,o,r,s,l;function u(e){var t;ue({working:!0});const i=document.elementFromPoint(e.clientX,e.clientY);if(void 0!==(null==(t=null==i?void 0:i.dataset)?void 0:t.ohbugSelector))return!1;!function(e){if(!e)return;const{width:t,height:i,top:u,right:c,bottom:a,left:d}=e.getBoundingClientRect();null==l||l.setAttribute("style",`\n width: ${t+4}px;\n height: ${i+4}px;\n top: ${u-2}px;\n left: ${d-2}px;\n `),null==n||n.setAttribute("style",`\n height: ${u}px;\n top: 0;\n right: 0;\n left: 0;\n `),null==o||o.setAttribute("style",`\n top: ${u}px;\n right: 0;\n bottom: 0;\n left: ${c}px;\n `),null==r||r.setAttribute("style",`\n width: ${t+d}px;\n top: ${a}px;\n bottom: 0;\n left: 0;\n `),null==s||s.setAttribute("style",`\n width: ${d}px;\n height: ${i}px;\n top: ${u}px;\n left: 0;\n `)}(i)}function c(){document.addEventListener("mousemove",u)}function a(){document.removeEventListener("mousemove",u)}function p(n){var o;const r=document.elementFromPoint(n.clientX,n.clientY);return void 0===(null==(o=null==r?void 0:r.dataset)?void 0:o.ohbugSelector)&&((!le.selectedElement||!le.working)&&(t(r),function(e){if(!e)return;const{width:t,height:n,top:o,left:r}=e.getBoundingClientRect();ue({selectedElement:e}),null==l||l.setAttribute("style",`\n width: ${t+4}px;\n height: ${n+4}px;\n top: ${o-2}px;\n left: ${r-2}px;\n `)}(e()),void a()))}function g(){document.removeEventListener("mousedown",p)}function b(){t(null),a(),g(),ue({working:!1,selectedElement:null})}function v(){ue({working:!0,selectedElement:null}),t(null),c()}var y;return h((()=>{le.working?(c(),document.addEventListener("mousedown",p)):(a(),g())})),y=b,null===i||(null===i.cleanups?i.cleanups=[y]:i.cleanups.push(y)),(()=>{const t=be.cloneNode(!0),i=t.firstChild,u=i.nextSibling,c=u.nextSibling,a=c.nextSibling,d=a.nextSibling;return M(t,j(C,{get when(){return!le.selectedElement&&le.working},get children(){const e=he.cloneNode(!0),t=e.firstChild.firstChild.nextSibling;return t.$$click=b,M(t,j(de,{})),e}}),i),n=i,(e=>{o=e})(u),(e=>{r=e})(c),(e=>{s=e})(a),(e=>{l=e})(d),M(d,j(C,{get when(){return le.selectedElement&&le.working},get children(){return[(()=>{const e=pe.cloneNode(!0);return e.$$click=b,M(e,j(de,{})),e})(),(()=>{const e=ge.cloneNode(!0);return e.$$click=v,e.style.setProperty("transform","translate(4px, -8px)"),e})()]}})),f((()=>d.className="fixed -z-1 bg-black bg-opacity-20 border-4 rounded-sm transition cursor-pointer box-border pointer-events-none "+(e()?"border-red-500 border-solid":"border-blue-500 border-dashed"))),t})()};H(["click"]);const ye=D('<button class="main-btn" type="button" data-ohbug-selector></button>'),me=D('<div class="w-80 h-60 fixed z-max right-8 bottom-20 shadow bg-white flex flex-col" data-ohbug-selector><div class="bg-gray-300 p-4" data-ohbug-selector><textarea class="bg-transparent outline-none resize-none w-full" placeholder="告诉我你的感受..." rows="4" maxlength="1000" autofocus data-ohbug-selector></textarea><button class="cursor-pointer" type="button" data-ohbug-selector></button></div><div class="flex justify-between items-center flex-1 p-4" data-ohbug-selector><span class="text-sm" data-ohbug-selector>试试<a class="underline" href="https://ohbug.net" target="_blank" rel="noreferrer" data-ohbug-selector>Ohbug</a>?</span><button class="send-btn" type="button" data-ohbug-selector></button></div><button class="bg-blue-500 cursor-pointer rounded-full w-6 h-6 flex items-center justify-center absolute -top-2 -right-2 z-10" type="button" data-ohbug-selector></button></div>'),we=D('<div class="relative z-max" data-ohbug-selector><div></div></div>'),xe=()=>{const[e,t]=d(!1),[n,o]=d("");function r(){ue({working:!0})}const[i,s]=d(!1);async function l(){s(!0);const e={target:le.selectedElement};let r,i;le.selectedElement&&(r=function(e){for(var t=e.target||e.srcElement,n=e.target||e.srcElement,o=[],r=0;n&&n.nodeType===Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_TYPE_NODE;n=n.previousSibling)r&&o.push(n),r+=1;var i=void 0===e.path?X(e.target):e.path,s=t.outerHTML;return i.reverse().map((function(e){return(e.localName||"")+(e.id?"#"+e.id:"")+(e.className?"."+e.className:"")+(e.outerHTML===s?":nth-child("+o.length+")":"")})).filter((function(e){return Boolean(e)})).join(" > ")}(e),i=le.selectedElement.outerHTML);const l=I().client,u=l.createEvent({category:"feedback",type:"feedback",detail:{selector:r,outerHTML:i,feedback:n()}});await l.notify(u),t(!1),o(""),ue({working:!1,selectedElement:null}),s(!1)}return h((()=>{!1===le.working&&null===le.selectedElement||le.working&&!le.selectedElement?t(!1):t(!0)})),(()=>{const s=we.cloneNode(!0),u=s.firstChild;return M(s,j(C,{get when(){return le.working},get children(){return j(ve,{})}}),u),M(u,j(C,{get when(){return!(le.working&&!le.selectedElement)},get children(){const n=ye.cloneNode(!0);return n.$$click=()=>t((e=>!e)),M(n,(()=>e()?"😆":"🙂")),n}}),null),M(u,j(C,{get when(){return e()},get children(){const e=me.cloneNode(!0),s=e.firstChild,u=s.firstChild,c=u.nextSibling,a=s.nextSibling,d=a.firstChild.nextSibling,h=a.nextSibling;return u.$$input=e=>o(e.target.value),c.$$click=r,M(c,j(fe,{})),d.$$click=l,M(d,(()=>i()?"Sending...":"Send")),h.$$click=()=>t((e=>!e)),M(h,j(de,{})),f((e=>{const t=n(),o=le.selectedElement?"blue":"gray",r=!n()||i();return t!==e._v$&&(u.value=e._v$=t),o!==e._v$2&&c.style.setProperty("--color",e._v$2=o),r!==e._v$3&&(d.disabled=e._v$3=r),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}}),null),s})()};H(["click","input"]);const $e={name:"OhbugExtensionFeedback",init:()=>{const e=document.createElement("div");e.id="OhbugExtensionFeedback-ROOT",document.body.appendChild(e),P((()=>j(xe,{})),e)}};return function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`/*! tailwindcss v2.2.15 | MIT License | https://tailwindcss.com*//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:-moz-focusring{outline:auto}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-border-opacity:1;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;border-color:rgba(229,231,235,var(--tw-border-opacity))}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.right-8{right:2rem}.bottom-20{bottom:5rem}.-top-2{top:-.5rem}.-right-2{right:-.5rem}.top-0{top:0}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.-top-3{top:-.75rem}.-right-3{right:-.75rem}.-bottom-full{bottom:-100%}.z-max{z-index:2147483640}.z-10{z-index:10}.-z-1{z-index:-1}.box-border{box-sizing:border-box}.flex{display:flex}.h-60{height:15rem}.h-6{height:1.5rem}.w-80{width:20rem}.w-full{width:100%}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.transform{transform:var(--tw-transform)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-full{border-radius:9999px}.rounded-sm{border-radius:.125rem}.border-4{border-width:4px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgba(209,213,219,var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity))}.bg-opacity-40{--tw-bg-opacity:0.4}.bg-opacity-20{--tw-bg-opacity:0.2}.bg-none{background-image:none}.p-4{padding:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.underline{text-decoration:underline}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
31
|
-
.send-btn{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-radius:.125rem;color:rgba(255,255,255,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem;padding:.25rem .75rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.send-btn:disabled{cursor:not-allowed;opacity:.5}
|
|
32
|
-
.main-btn{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06);align-items:center;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-radius:.25rem;bottom:2rem;color:rgba(255,255,255,var(--tw-text-opacity));cursor:pointer;display:flex;height:2rem;justify-content:center;position:fixed;right:2rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:2.5rem;z-index:2147483640}.main-btn,.main-btn:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.main-btn:hover{--tw-bg-opacity:1;--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);background-color:rgba(37,99,235,var(--tw-bg-opacity))}
|
|
33
|
-
.stop-btn{margin-left:.25rem;pointer-events:auto;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.stop-btn:hover{--tw-bg-opacity:1;--tw-bg-opacity:0.3;background-color:rgba(107,114,128,var(--tw-bg-opacity))}
|
|
34
|
-
.tips{--tw-translate-x:-50%;--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgba(59,130,246,var(--tw-bg-opacity));border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;color:rgba(255,255,255,var(--tw-text-opacity));display:flex;font-size:.875rem;left:50%;line-height:1.25rem;padding:.75rem;position:fixed;top:0;transform:var(--tw-transform);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2147483640}`),$e}));
|
package/dist/src/Box.d.ts
DELETED
package/dist/src/Box.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["Box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,UAAU,CAAA;AAMtE,OAAO,gBAAgB,CAAA;AACvB,OAAO,gBAAgB,CAAA;AAEvB,QAAA,MAAM,GAAG,EAAE,SA0IV,CAAA;AAED,eAAe,GAAG,CAAA"}
|
package/dist/src/Selector.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["Selector.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,UAAU,CAAA;AAIjB,OAAO,YAAY,CAAA;AACnB,OAAO,gBAAgB,CAAA;AAEvB,QAAA,MAAM,QAAQ,EAAE,SAqPf,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
package/dist/src/assets.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["assets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,eAAO,MAAM,KAAK,EAAE,SAenB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,SAepB,CAAA"}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,0BAA0B,CAAA;AAKjC,QAAA,MAAM,SAAS,4CASb,CAAA;AAEF,eAAe,SAAS,CAAA"}
|
package/dist/src/store.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const store: import("solid-js/store").Store<{
|
|
2
|
-
working: boolean;
|
|
3
|
-
selectedElement: Element | null;
|
|
4
|
-
}>, setStore: import("solid-js/store").SetStoreFunction<{
|
|
5
|
-
working: boolean;
|
|
6
|
-
selectedElement: Element | null;
|
|
7
|
-
}>;
|
|
8
|
-
export { store, setStore };
|
|
9
|
-
//# sourceMappingURL=store.d.ts.map
|