react-text-range 1.0.3 → 1.0.5

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.
@@ -1,4 +1,5 @@
1
1
  import React, { FC } from 'react';
2
+ import './main.css';
2
3
  export declare const FullWindow: FC<{
3
4
  children: React.ReactNode;
4
5
  }>;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { HandlerPos } from './handler-pos';
3
+ import './main.css';
3
4
  export declare const SelectionHandler: FC<{
4
5
  pos: HandlerPos | null;
5
6
  grab: boolean;
package/dist/cjs/index.js CHANGED
@@ -3,24 +3,54 @@
3
3
  var React = require('react');
4
4
 
5
5
  function _interopNamespaceDefault(e) {
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
6
+ var n = Object.create(null);
7
+ if (e) {
8
+ Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default') {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
16
14
  });
17
- }
18
- n.default = e;
19
- return Object.freeze(n);
15
+ }
16
+ });
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
20
  }
21
21
 
22
22
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
23
23
 
24
+ function styleInject(css, ref) {
25
+ if ( ref === void 0 ) ref = {};
26
+ var insertAt = ref.insertAt;
27
+
28
+ if (!css || typeof document === 'undefined') { return; }
29
+
30
+ var head = document.head || document.getElementsByTagName('head')[0];
31
+ var style = document.createElement('style');
32
+ style.type = 'text/css';
33
+
34
+ if (insertAt === 'top') {
35
+ if (head.firstChild) {
36
+ head.insertBefore(style, head.firstChild);
37
+ } else {
38
+ head.appendChild(style);
39
+ }
40
+ } else {
41
+ head.appendChild(style);
42
+ }
43
+
44
+ if (style.styleSheet) {
45
+ style.styleSheet.cssText = css;
46
+ } else {
47
+ style.appendChild(document.createTextNode(css));
48
+ }
49
+ }
50
+
51
+ var css_248z = "@tailwind base;@tailwind components;@tailwind utilities;";
52
+ styleInject(css_248z,{"insertAt":"top"});
53
+
24
54
  const fullWindow = {
25
55
  height: '100vh',
26
56
  widows: '100%',
@@ -1,4 +1,5 @@
1
1
  import React, { FC } from 'react';
2
+ import './main.css';
2
3
  export declare const FullWindow: FC<{
3
4
  children: React.ReactNode;
4
5
  }>;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { HandlerPos } from './handler-pos';
3
+ import './main.css';
3
4
  export declare const SelectionHandler: FC<{
4
5
  pos: HandlerPos | null;
5
6
  grab: boolean;
package/dist/esm/index.js CHANGED
@@ -1,6 +1,36 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useRef, useEffect } from 'react';
3
3
 
4
+ function styleInject(css, ref) {
5
+ if ( ref === void 0 ) ref = {};
6
+ var insertAt = ref.insertAt;
7
+
8
+ if (!css || typeof document === 'undefined') { return; }
9
+
10
+ var head = document.head || document.getElementsByTagName('head')[0];
11
+ var style = document.createElement('style');
12
+ style.type = 'text/css';
13
+
14
+ if (insertAt === 'top') {
15
+ if (head.firstChild) {
16
+ head.insertBefore(style, head.firstChild);
17
+ } else {
18
+ head.appendChild(style);
19
+ }
20
+ } else {
21
+ head.appendChild(style);
22
+ }
23
+
24
+ if (style.styleSheet) {
25
+ style.styleSheet.cssText = css;
26
+ } else {
27
+ style.appendChild(document.createTextNode(css));
28
+ }
29
+ }
30
+
31
+ var css_248z = "@tailwind base;@tailwind components;@tailwind utilities;";
32
+ styleInject(css_248z,{"insertAt":"top"});
33
+
4
34
  const fullWindow = {
5
35
  height: '100vh',
6
36
  widows: '100%',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-text-range",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "text selection editor for React",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -39,9 +39,11 @@
39
39
  "@testing-library/react": "^14.0.0",
40
40
  "@types/jest": "^29.5.5",
41
41
  "@types/react": "^18.2.24",
42
+ "autoprefixer": "^10.4.16",
42
43
  "jest": "^29.7.0",
43
44
  "jest-canvas-mock": "^2.5.2",
44
45
  "jest-environment-jsdom": "^29.7.0",
46
+ "postcss": "^8.4.31",
45
47
  "react": "^18.2.0",
46
48
  "react-dom": "^18.2.0",
47
49
  "rollup": "^3.29.4",