@pie-lib/text-select 1.8.12 → 1.8.13
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/CHANGELOG.md +8 -0
- package/lib/text-select.js.map +1 -1
- package/package.json +2 -2
- package/src/text-select.jsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.8.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.8.12...@pie-lib/text-select@1.8.13) (2022-02-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-lib/text-select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.8.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.8.11...@pie-lib/text-select@1.8.12) (2022-02-03)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-lib/text-select
|
package/lib/text-select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/text-select.jsx"],"names":["log","TextSelect","tokens","onChange","props","out","filter","t","selected","map","start","end","text","disabled","selectedTokens","className","highlightChoices","maxNoOfSelections","animationsDisabled","normalized","prepped","selectedIndex","findIndex","s","correct","undefined","selectable","predefined","change","React","Component","PropTypes","func","bool","arrayOf","shape","TokenTypes","isRequired","string","number"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/text-select.jsx"],"names":["log","TextSelect","tokens","onChange","props","out","filter","t","selected","map","start","end","text","disabled","selectedTokens","className","highlightChoices","maxNoOfSelections","animationsDisabled","normalized","prepped","selectedIndex","findIndex","s","correct","undefined","selectable","predefined","change","React","Component","PropTypes","func","bool","arrayOf","shape","TokenTypes","isRequired","string","number"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,sBAAN,CAAZ;AACA;;;;IAGqBC,U;;;;;;;;;;;;;;;;;;6DAaV,UAAAC,MAAM,EAAI;AAAA,UACTC,QADS,GACI,MAAKC,KADT,CACTD,QADS;;AAGjB,UAAI,CAACA,QAAL,EAAe;AACb;AACD;;AACD,UAAME,GAAG,GAAGH,MAAM,CAACI,MAAP,CAAc,UAAAC,CAAC;AAAA,eAAIA,CAAC,CAACC,QAAN;AAAA,OAAf,EAA+BC,GAA/B,CAAmC,UAAAF,CAAC;AAAA,eAAK;AAAEG,UAAAA,KAAK,EAAEH,CAAC,CAACG,KAAX;AAAkBC,UAAAA,GAAG,EAAEJ,CAAC,CAACI;AAAzB,SAAL;AAAA,OAApC,CAAZ;AAEAR,MAAAA,QAAQ,CAACE,GAAD,CAAR;AACD,K;;;;;;;6BAEQ;AAAA,wBAUH,KAAKD,KAVF;AAAA,UAELQ,IAFK,eAELA,IAFK;AAAA,UAGLC,QAHK,eAGLA,QAHK;AAAA,UAILX,MAJK,eAILA,MAJK;AAAA,UAKLY,cALK,eAKLA,cALK;AAAA,UAMLC,SANK,eAMLA,SANK;AAAA,UAOLC,gBAPK,eAOLA,gBAPK;AAAA,UAQLC,iBARK,eAQLA,iBARK;AAAA,UASLC,kBATK,eASLA,kBATK;AAYP,UAAMC,UAAU,GAAG,wBAAUP,IAAV,EAAgBV,MAAhB,CAAnB;AACAF,MAAAA,GAAG,CAAC,cAAD,EAAiBmB,UAAjB,CAAH;AACA,UAAMC,OAAO,GAAGD,UAAU,CAACV,GAAX,CAAe,UAAAF,CAAC,EAAI;AAClC,YAAMc,aAAa,GAAGP,cAAc,CAACQ,SAAf,CAAyB,UAAAC,CAAC,EAAI;AAClD,iBAAOA,CAAC,C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AAEa,sBAAUE,IARb;AASjBhB,EAAAA,iBAAiB,EAAEc,sBAAUQ;AATZ,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport TokenSelect from './token-select';\nimport { normalize } from './tokenizer/builder';\nimport { TokenTypes } from './token-select/token';\nimport debug from 'debug';\n\nconst log = debug('@pie-lib:text-select');\n/**\n * Built on TokenSelect uses build.normalize to build the token set.\n */\nexport default class TextSelect extends React.Component {\n static propTypes = {\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n tokens: PropTypes.arrayOf(PropTypes.shape(TokenTypes)).isRequired,\n selectedTokens: PropTypes.arrayOf(PropTypes.shape(TokenTypes)).isRequired,\n text: PropTypes.string.isRequired,\n className: PropTypes.string,\n highlightChoices: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n maxNoOfSelections: PropTypes.number\n };\n\n change = tokens => {\n const { onChange } = this.props;\n\n if (!onChange) {\n return;\n }\n const out = tokens.filter(t => t.selected).map(t => ({ start: t.start, end: t.end }));\n\n onChange(out);\n };\n\n render() {\n const {\n text,\n disabled,\n tokens,\n selectedTokens,\n className,\n highlightChoices,\n maxNoOfSelections,\n animationsDisabled\n } = this.props;\n\n const normalized = normalize(text, tokens);\n log('normalized: ', normalized);\n const prepped = normalized.map(t => {\n const selectedIndex = selectedTokens.findIndex(s => {\n return s.start === t.start && s.end === t.end;\n });\n const selected = selectedIndex !== -1;\n const correct = selected ? t.correct : undefined;\n return {\n ...t,\n selectable: !disabled && t.predefined,\n selected,\n correct\n };\n });\n\n return (\n <TokenSelect\n highlightChoices={!disabled && highlightChoices}\n className={className}\n tokens={prepped}\n disabled={disabled}\n onChange={this.change}\n maxNoOfSelections={maxNoOfSelections}\n animationsDisabled={animationsDisabled}\n />\n );\n }\n}\n"],"file":"text-select.js"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.13",
|
|
7
7
|
"description": "Some react components for text selection",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"@material-ui/core": "^3.8.3",
|
|
39
39
|
"react": "^16.8.1"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "cb14b616e7d4d4eb0506b85a5906924adad39165",
|
|
42
42
|
"scripts": {}
|
|
43
43
|
}
|
package/src/text-select.jsx
CHANGED
|
@@ -5,6 +5,7 @@ import TokenSelect from './token-select';
|
|
|
5
5
|
import { normalize } from './tokenizer/builder';
|
|
6
6
|
import { TokenTypes } from './token-select/token';
|
|
7
7
|
import debug from 'debug';
|
|
8
|
+
|
|
8
9
|
const log = debug('@pie-lib:text-select');
|
|
9
10
|
/**
|
|
10
11
|
* Built on TokenSelect uses build.normalize to build the token set.
|