@khanacademy/perseus-editor 4.1.6 → 4.1.8

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 * as React from "react";
2
+ import type Editor from "../editor";
2
3
  import type { PerseusWidget } from "@khanacademy/perseus";
3
4
  type WidgetEditorProps = {
4
5
  id: string;
@@ -11,6 +12,7 @@ type WidgetEditorState = {
11
12
  widgetInfo: PerseusWidget;
12
13
  };
13
14
  declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEditorState> {
15
+ widget: React.RefObject<Editor>;
14
16
  constructor(props: WidgetEditorProps);
15
17
  UNSAFE_componentWillReceiveProps(nextProps: WidgetEditorProps): void;
16
18
  _toggleWidget: (e: React.SyntheticEvent) => void;
@@ -23,7 +25,12 @@ declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEdit
23
25
  alignment: string | undefined;
24
26
  static: boolean | undefined;
25
27
  graded: boolean | undefined;
26
- options: any;
28
+ options: {
29
+ content: string;
30
+ images: any;
31
+ replace: any;
32
+ widgets: Record<any, any>;
33
+ };
27
34
  version: import("../../../perseus/src/perseus-types").Version | undefined;
28
35
  };
29
36
  render(): React.ReactNode;
package/dist/es/index.js CHANGED
@@ -25,7 +25,7 @@ import * as i18n$1 from '@khanacademy/wonder-blocks-i18n';
25
25
 
26
26
  // This file is processed by a Rollup plugin (replace) to inject the production
27
27
  const libName = "@khanacademy/perseus-editor";
28
- const libVersion = "4.1.6";
28
+ const libVersion = "4.1.8";
29
29
  addLibraryVersionToPerseusDebug(libName, libVersion);
30
30
 
31
31
  function _extends() {
@@ -20573,6 +20573,7 @@ const _upgradeWidgetInfo = props => {
20573
20573
  class WidgetEditor extends React.Component {
20574
20574
  constructor(props) {
20575
20575
  super(props);
20576
+ this.widget = void 0;
20576
20577
  this._toggleWidget = e => {
20577
20578
  e.preventDefault();
20578
20579
  this.setState({
@@ -20580,11 +20581,10 @@ class WidgetEditor extends React.Component {
20580
20581
  });
20581
20582
  };
20582
20583
  this._handleWidgetChange = (newProps, cb, silent) => {
20583
- const newWidgetInfo = Object.assign({}, this.state.widgetInfo);
20584
- newWidgetInfo.options = Object.assign(
20585
- // eslint-disable-next-line react/no-string-refs
20586
- // @ts-expect-error - TS2339 - Property 'serialize' does not exist on type 'ReactInstance'.
20587
- this.refs.widget.serialize(), newProps);
20584
+ var _this$widget$current$, _this$widget$current;
20585
+ const newWidgetInfo = _extends({}, this.state.widgetInfo, {
20586
+ options: _extends({}, this.state.widgetInfo.options, (_this$widget$current$ = (_this$widget$current = this.widget.current) == null ? void 0 : _this$widget$current.serialize()) != null ? _this$widget$current$ : {}, newProps)
20587
+ });
20588
20588
  this.props.onChange(newWidgetInfo, cb, silent);
20589
20589
  };
20590
20590
  this._toggleStatic = e => {
@@ -20601,9 +20601,8 @@ class WidgetEditor extends React.Component {
20601
20601
  this.props.onChange(newWidgetInfo);
20602
20602
  };
20603
20603
  this.getSaveWarnings = () => {
20604
- // eslint-disable-next-line react/no-string-refs
20605
- // @ts-expect-error - TS2339 - Property 'getSaveWarnings' does not exist on type 'ReactInstance'.
20606
- const issuesFunc = this.refs.widget.getSaveWarnings;
20604
+ var _this$widget$current2;
20605
+ const issuesFunc = (_this$widget$current2 = this.widget.current) == null ? void 0 : _this$widget$current2.getSaveWarnings;
20607
20606
  return issuesFunc ? issuesFunc() : [];
20608
20607
  };
20609
20608
  this.serialize = () => {
@@ -20618,7 +20617,7 @@ class WidgetEditor extends React.Component {
20618
20617
  graded: widgetInfo.graded,
20619
20618
  // eslint-disable-next-line react/no-string-refs
20620
20619
  // @ts-expect-error - TS2339 - Property 'serialize' does not exist on type 'ReactInstance'.
20621
- options: this.refs.widget.serialize(),
20620
+ options: this.widget.current.serialize(),
20622
20621
  version: widgetInfo.version
20623
20622
  };
20624
20623
  };
@@ -20626,6 +20625,7 @@ class WidgetEditor extends React.Component {
20626
20625
  showWidget: false,
20627
20626
  widgetInfo: _upgradeWidgetInfo(props)
20628
20627
  };
20628
+ this.widget = /*#__PURE__*/React.createRef();
20629
20629
  }
20630
20630
 
20631
20631
  // eslint-disable-next-line react/no-unsafe
@@ -20674,10 +20674,8 @@ class WidgetEditor extends React.Component {
20674
20674
  title: "Remove image widget"
20675
20675
  })), /*#__PURE__*/React.createElement("div", {
20676
20676
  className: "perseus-widget-editor-content " + (this.state.showWidget ? "enter" : "leave")
20677
- }, Ed && /*#__PURE__*/React.createElement(Ed
20678
- // eslint-disable-next-line react/no-string-refs
20679
- , _extends({
20680
- ref: "widget",
20677
+ }, Ed && /*#__PURE__*/React.createElement(Ed, _extends({
20678
+ ref: this.widget,
20681
20679
  onChange: this._handleWidgetChange,
20682
20680
  static: widgetInfo.static,
20683
20681
  apiOptions: this.props.apiOptions
@@ -24374,366 +24372,222 @@ function _objectWithoutPropertiesLoose(source, excluded) {
24374
24372
  return target;
24375
24373
  }
24376
24374
 
24377
- var hubble = {exports: {}};
24375
+ var isObject = function isObject(obj) {
24376
+ return obj === Object(obj);
24377
+ };
24378
+ var merge = function merge() {
24379
+ var obj = {};
24380
+ for (var i = 0; i < arguments.length; i++) {
24381
+ var source = arguments[i];
24382
+ if (source) {
24383
+ for (var prop in source) {
24384
+ obj[prop] = source[prop];
24385
+ }
24386
+ }
24387
+ }
24388
+ return obj;
24389
+ };
24390
+ var clone = function clone(obj) {
24391
+ if (!isObject(obj)) {
24392
+ return obj;
24393
+ }
24394
+ return Array.isArray(obj) ? obj.slice() : merge(obj);
24395
+ };
24378
24396
 
24379
- (function (module, exports) {
24380
- (function webpackUniversalModuleDefinition(root, factory) {
24381
- module.exports = factory();
24382
- })(commonjsGlobal, function () {
24383
- return (/******/function (modules) {
24384
- // webpackBootstrap
24385
- /******/ // The module cache
24386
- /******/
24387
- var installedModules = {};
24388
- /******/
24389
- /******/ // The require function
24390
- /******/
24391
- function __webpack_require__(moduleId) {
24392
- /******/
24393
- /******/ // Check if module is in cache
24394
- /******/if (installedModules[moduleId]) {
24395
- /******/return installedModules[moduleId].exports;
24396
- /******/
24397
- }
24398
- /******/ // Create a new module (and put it into the cache)
24399
- /******/
24400
- var module = installedModules[moduleId] = {
24401
- /******/i: moduleId,
24402
- /******/l: false,
24403
- /******/exports: {}
24404
- /******/
24405
- };
24406
- /******/
24407
- /******/ // Execute the module function
24408
- /******/
24409
- modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
24410
- /******/
24411
- /******/ // Flag the module as loaded
24412
- /******/
24413
- module.l = true;
24414
- /******/
24415
- /******/ // Return the exports of the module
24416
- /******/
24417
- return module.exports;
24418
- /******/
24419
- }
24420
- /******/
24421
- /******/
24422
- /******/ // expose the modules object (__webpack_modules__)
24423
- /******/
24424
- __webpack_require__.m = modules;
24425
- /******/
24426
- /******/ // expose the module cache
24427
- /******/
24428
- __webpack_require__.c = installedModules;
24429
- /******/
24430
- /******/ // define getter function for harmony exports
24431
- /******/
24432
- __webpack_require__.d = function (exports, name, getter) {
24433
- /******/if (!__webpack_require__.o(exports, name)) {
24434
- /******/Object.defineProperty(exports, name, {
24435
- /******/configurable: false,
24436
- /******/enumerable: true,
24437
- /******/get: getter
24438
- /******/
24439
- });
24440
- /******/
24441
- }
24442
- /******/
24443
- };
24444
- /******/
24445
- /******/ // getDefaultExport function for compatibility with non-harmony modules
24446
- /******/
24447
- __webpack_require__.n = function (module) {
24448
- /******/var getter = module && module.__esModule ? /******/function getDefault() {
24449
- return module['default'];
24450
- } : /******/function getModuleExports() {
24451
- return module;
24452
- };
24453
- /******/
24454
- __webpack_require__.d(getter, 'a', getter);
24455
- /******/
24456
- return getter;
24457
- /******/
24458
- };
24459
- /******/
24460
- /******/ // Object.prototype.hasOwnProperty.call
24461
- /******/
24462
- __webpack_require__.o = function (object, property) {
24463
- return Object.prototype.hasOwnProperty.call(object, property);
24464
- };
24465
- /******/
24466
- /******/ // __webpack_public_path__
24467
- /******/
24468
- __webpack_require__.p = "";
24469
- /******/
24470
- /******/ // Load entry module and return exports
24471
- /******/
24472
- return __webpack_require__(__webpack_require__.s = 1);
24473
- /******/
24474
- }
24475
- /************************************************************************/
24476
- /******/([/* 0 */
24477
- /***/function (module, exports) {
24478
- var isObject = function isObject(obj) {
24479
- return obj === Object(obj);
24480
- };
24481
- var merge = function merge() {
24482
- var obj = {};
24483
- for (var i = 0; i < arguments.length; i++) {
24484
- var source = arguments[i];
24485
- if (source) {
24486
- for (var prop in source) {
24487
- obj[prop] = source[prop];
24488
- }
24489
- }
24490
- }
24491
- return obj;
24492
- };
24493
- var clone = function clone(obj) {
24494
- if (!isObject(obj)) {
24495
- return obj;
24496
- }
24497
- return Array.isArray(obj) ? obj.slice() : merge(obj);
24498
- };
24499
- module.exports = {
24500
- isObject: isObject,
24501
- merge: merge,
24502
- clone: clone
24503
- };
24397
+ /* TODO batch *all* mutations
24398
+ * idea: freeze / thaw implementations for all types
24399
+ * lens constructor thaws, freeze delegates to type's freeze
24400
+ */
24504
24401
 
24505
- /***/
24506
- }, /* 1 */
24507
- /***/function (module, exports, __webpack_require__) {
24508
- /* TODO batch *all* mutations
24509
- * idea: freeze / thaw implementations for all types
24510
- * lens constructor thaws, freeze delegates to type's freeze
24511
- */
24512
-
24513
- var util = __webpack_require__(0);
24514
- var clone = util.clone;
24515
- var isObject = util.isObject;
24516
- var merge = util.merge;
24517
- var arr = __webpack_require__(2);
24518
- var obj = __webpack_require__(3);
24519
- var str = __webpack_require__(4);
24520
-
24521
- // equivalents, without requiring it
24522
- // find the implementation to use for a given object
24523
- var dispatch = function dispatch(x) {
24524
- if (Array.isArray(x)) {
24525
- return arr;
24526
- } else if (isObject(x)) {
24527
- return obj;
24528
- } else if (typeof x === "string") {
24529
- return str;
24530
- }
24531
- };
24402
+ // equivalents, without requiring it
24403
+ // find the implementation to use for a given object
24404
+ var dispatch = function dispatch(x) {
24405
+ if (Array.isArray(x)) {
24406
+ return arr;
24407
+ } else if (isObject(x)) {
24408
+ return obj;
24409
+ } else if (typeof x === "string") {
24410
+ return str;
24411
+ }
24412
+ };
24532
24413
 
24533
- // This is underscore with a different name
24534
- var lens = function lens(obj) {
24535
- if (obj instanceof lens) {
24536
- return obj;
24537
- }
24538
- if (!(this instanceof lens)) {
24539
- return new lens(obj);
24540
- }
24541
- var ops = dispatch(obj);
24542
- this._wrapped = ops.thaw ? ops.thaw(obj) : obj;
24543
- };
24544
- lens.prototype.freeze = function () {
24545
- var obj = this._wrapped;
24546
- var ops = dispatch(obj);
24547
- return ops.freeze ? ops.freeze(obj) : obj;
24548
- };
24549
- lens.prototype.zoom = function (lensArr) {
24550
- if (this._zoomStack === undefined) {
24551
- this._zoomStack = [];
24552
- }
24553
- this._zoomStack.push({
24554
- zoom: lensArr,
24555
- wrapped: this._wrapped
24556
- });
24557
- this._wrapped = lens(this._wrapped).get(lensArr);
24558
- return this;
24559
- };
24560
- lens.prototype.deZoom = function () {
24561
- var frame = this._zoomStack.pop();
24562
- this._wrapped = lens(frame.wrapped).set(frame.zoom, this._wrapped).freeze();
24563
- return this;
24564
- };
24565
- lens.prototype.get = function (lensArr) {
24566
- var obj = this._wrapped;
24567
- for (var i = 0; i < lensArr.length; i++) {
24568
- obj = dispatch(obj).get(obj, lensArr[i]);
24569
- }
24570
- return obj;
24571
- };
24572
- lens.prototype.mod = function (lensArr, f) {
24573
- var obj = this._wrapped;
24574
- var newObj = clone(obj);
24575
- var ops = dispatch(obj);
24576
- if (lensArr.length === 0) {
24577
- this._wrapped = f(this._wrapped);
24578
- } else if (lensArr.length === 1) {
24579
- this._wrapped = ops.mod(newObj, lensArr[0], f);
24580
- } else {
24581
- var monocle = lensArr[0];
24582
- var shortLens = lensArr.slice(1);
24414
+ // This is underscore with a different name
24415
+ var lens = function lens(obj) {
24416
+ if (obj instanceof lens) {
24417
+ return obj;
24418
+ }
24419
+ if (!(this instanceof lens)) {
24420
+ return new lens(obj);
24421
+ }
24422
+ var ops = dispatch(obj);
24423
+ this._wrapped = ops.thaw ? ops.thaw(obj) : obj;
24424
+ };
24425
+ lens.prototype.freeze = function () {
24426
+ var obj = this._wrapped;
24427
+ var ops = dispatch(obj);
24428
+ return ops.freeze ? ops.freeze(obj) : obj;
24429
+ };
24430
+ lens.prototype.zoom = function (lensArr) {
24431
+ if (this._zoomStack === undefined) {
24432
+ this._zoomStack = [];
24433
+ }
24434
+ this._zoomStack.push({
24435
+ zoom: lensArr,
24436
+ wrapped: this._wrapped
24437
+ });
24438
+ this._wrapped = lens(this._wrapped).get(lensArr);
24439
+ return this;
24440
+ };
24441
+ lens.prototype.deZoom = function () {
24442
+ var frame = this._zoomStack.pop();
24443
+ this._wrapped = lens(frame.wrapped).set(frame.zoom, this._wrapped).freeze();
24444
+ return this;
24445
+ };
24446
+ lens.prototype.get = function (lensArr) {
24447
+ var obj = this._wrapped;
24448
+ for (var i = 0; i < lensArr.length; i++) {
24449
+ obj = dispatch(obj).get(obj, lensArr[i]);
24450
+ }
24451
+ return obj;
24452
+ };
24453
+ lens.prototype.mod = function (lensArr, f) {
24454
+ var obj = this._wrapped;
24455
+ var newObj = clone(obj);
24456
+ var ops = dispatch(obj);
24457
+ if (lensArr.length === 0) {
24458
+ this._wrapped = f(this._wrapped);
24459
+ } else if (lensArr.length === 1) {
24460
+ this._wrapped = ops.mod(newObj, lensArr[0], f);
24461
+ } else {
24462
+ var monocle = lensArr[0];
24463
+ var shortLens = lensArr.slice(1);
24583
24464
 
24584
- // newObj = ops.mod(obj[monocle], shortLens, f);
24465
+ // newObj = ops.mod(obj[monocle], shortLens, f);
24585
24466
 
24586
- newObj[monocle] = lens(obj[monocle]).mod(shortLens, f).freeze();
24587
- this._wrapped = newObj;
24588
- }
24589
- return this;
24590
- };
24467
+ newObj[monocle] = lens(obj[monocle]).mod(shortLens, f).freeze();
24468
+ this._wrapped = newObj;
24469
+ }
24470
+ return this;
24471
+ };
24591
24472
 
24592
- // TODO - move to individual files
24593
- lens.prototype.merge = function (lensArr, props) {
24594
- this._wrapped = lens(this._wrapped).mod(lensArr, function (oldProps) {
24595
- return merge(oldProps, props);
24596
- }).freeze();
24597
- return this;
24598
- };
24473
+ // TODO - move to individual files
24474
+ lens.prototype.merge = function (lensArr, props) {
24475
+ this._wrapped = lens(this._wrapped).mod(lensArr, function (oldProps) {
24476
+ return merge(oldProps, props);
24477
+ }).freeze();
24478
+ return this;
24479
+ };
24599
24480
 
24600
- // Lens must have length >= 1 or there would be nothing to return
24601
- lens.prototype.del = function (lensArr) {
24602
- var obj = this._wrapped;
24603
- var ops = dispatch(obj);
24604
- if (lensArr.length === 1) {
24605
- this._wrapped = ops.del(obj, lensArr[0]);
24606
- } else {
24607
- var monocle = lensArr[0];
24608
- var shortLens = lensArr.slice(1);
24609
- var newObj = clone(obj);
24610
- newObj[monocle] = lens(obj[monocle]).del(shortLens).freeze();
24611
- this._wrapped = newObj;
24612
- }
24613
- return this;
24614
- };
24615
- lens.prototype.set = function (lensArr, set) {
24616
- return this.mod(lensArr, function () {
24617
- return set;
24618
- });
24619
- };
24620
- module.exports = lens;
24481
+ // Lens must have length >= 1 or there would be nothing to return
24482
+ lens.prototype.del = function (lensArr) {
24483
+ var obj = this._wrapped;
24484
+ var ops = dispatch(obj);
24485
+ if (lensArr.length === 1) {
24486
+ this._wrapped = ops.del(obj, lensArr[0]);
24487
+ } else {
24488
+ var monocle = lensArr[0];
24489
+ var shortLens = lensArr.slice(1);
24490
+ var newObj = clone(obj);
24491
+ newObj[monocle] = lens(obj[monocle]).del(shortLens).freeze();
24492
+ this._wrapped = newObj;
24493
+ }
24494
+ return this;
24495
+ };
24496
+ lens.prototype.set = function (lensArr, set) {
24497
+ return this.mod(lensArr, function () {
24498
+ return set;
24499
+ });
24500
+ };
24621
24501
 
24622
- /***/
24623
- }, /* 2 */
24624
- /***/function (module, exports) {
24625
- var get = function get(arr, monocle) {
24626
- return arr[monocle];
24627
- };
24628
- var set = function set(arr, monocle, val) {
24629
- var newArr = arr.splice();
24630
- newArr[monocle] = val;
24631
- return newArr;
24632
- };
24633
- var mod = function mod(arr, monocle, f) {
24634
- var newArr = arr.slice();
24635
- newArr[monocle] = f(arr[monocle]);
24636
- return newArr;
24637
- };
24638
- var del = function del(arr, monocle) {
24639
- var newArr = arr.slice();
24640
- newArr.splice(monocle, 1);
24641
- return newArr;
24642
- };
24502
+ // ARRAY FUNCTIONS
24643
24503
 
24644
- /*
24645
- // Lens must point to a member of an array. We'll insert into that array.
24646
- lens.prototype.insertAt = function(lensArr, toInsert) {
24647
- var obj = this._wrapped;
24648
-
24649
- var arrLens = lensArr.slice(0, -1);
24650
- var arr = lens(obj).get(arrLens).slice(); // slice to copy
24651
-
24652
- var arrIdx = lensArr[lensArr.length-1];
24653
- arr.splice(arrIdx, 0, toInsert);
24654
- return lens(obj).set(arrLens, arr);
24655
- };
24656
-
24657
- lens.prototype.insertBefore = lens.prototype.insertAt;
24658
- lens.prototype.insertAfter = function(lensArr, toInsert) {
24659
- var newLens = lensArr.slice();
24660
- newLens[newLens.length-1] += 1;
24661
- return lens(this._wrapped).insertAt(newLens, toInsert);
24662
- };
24663
- */
24504
+ const arr = {
24505
+ get: function (arr, monocle) {
24506
+ return arr[monocle];
24507
+ },
24508
+ set: function (arr, monocle, val) {
24509
+ var newArr = arr.splice();
24510
+ newArr[monocle] = val;
24511
+ return newArr;
24512
+ },
24513
+ mod: function (arr, monocle, f) {
24514
+ var newArr = arr.slice();
24515
+ newArr[monocle] = f(arr[monocle]);
24516
+ return newArr;
24517
+ },
24518
+ del: function (arr, monocle) {
24519
+ var newArr = arr.slice();
24520
+ newArr.splice(monocle, 1);
24521
+ return newArr;
24522
+ }
24523
+ };
24664
24524
 
24665
- module.exports = {
24666
- get: get,
24667
- set: set,
24668
- mod: mod,
24669
- del: del
24670
- };
24525
+ /*
24526
+ // Lens must point to a member of an array. We'll insert into that array.
24527
+ lens.prototype.insertAt = function(lensArr, toInsert) {
24528
+ var obj = this._wrapped;
24671
24529
 
24672
- /***/
24673
- }, /* 3 */
24674
- /***/function (module, exports, __webpack_require__) {
24675
- var clone = __webpack_require__(0).clone;
24676
- var get = function get(obj, monocle) {
24677
- return obj[monocle];
24678
- };
24679
- var set = function set(obj, monocle, val) {
24680
- var newObj = clone(obj);
24681
- newObj[monocle] = val;
24682
- return newObj;
24683
- };
24684
- var mod = function mod(obj, monocle, f) {
24685
- var newObj = clone(obj);
24686
- newObj[monocle] = f(obj[monocle]);
24687
- return newObj;
24688
- };
24689
- var del = function del(obj, monocle) {
24690
- var newObj = clone(obj);
24691
- delete newObj[monocle];
24692
- return newObj;
24693
- };
24694
- module.exports = {
24695
- get: get,
24696
- set: set,
24697
- mod: mod,
24698
- del: del
24699
- };
24530
+ var arrLens = lensArr.slice(0, -1);
24531
+ var arr = lens(obj).get(arrLens).slice(); // slice to copy
24700
24532
 
24701
- /***/
24702
- }, /* 4 */
24703
- /***/function (module, exports) {
24704
- var get = function get(arr, monocle) {
24705
- return arr[monocle];
24706
- };
24707
- var set = function set(arr, monocle, val) {
24708
- var newArr = arr.splice();
24709
- newArr[monocle] = val;
24710
- return newArr;
24711
- };
24712
- var mod = function mod(arr, monocle, f) {
24713
- var newArr = arr.splice();
24714
- newArr[monocle] = f(arr[monocle]);
24715
- return newArr;
24716
- };
24717
- var del = function del(arr, monocle) {
24718
- var newArr = arr.slice();
24719
- newArr.splice(monocle);
24720
- return newArr;
24721
- };
24722
- module.exports = {
24723
- get: get,
24724
- set: set,
24725
- mod: mod,
24726
- del: del
24727
- };
24533
+ var arrIdx = lensArr[lensArr.length-1];
24534
+ arr.splice(arrIdx, 0, toInsert);
24535
+ return lens(obj).set(arrLens, arr);
24536
+ };
24728
24537
 
24729
- /***/
24730
- }
24731
- /******/])
24732
- );
24733
- });
24734
- } (hubble));
24538
+ lens.prototype.insertBefore = lens.prototype.insertAt;
24539
+ lens.prototype.insertAfter = function(lensArr, toInsert) {
24540
+ var newLens = lensArr.slice();
24541
+ newLens[newLens.length-1] += 1;
24542
+ return lens(this._wrapped).insertAt(newLens, toInsert);
24543
+ };
24544
+ */
24545
+
24546
+ // OBJECT FUNCTIONS
24547
+
24548
+ const obj = {
24549
+ get: function (obj, monocle) {
24550
+ return obj[monocle];
24551
+ },
24552
+ set: function (obj, monocle, val) {
24553
+ var newObj = clone(obj);
24554
+ newObj[monocle] = val;
24555
+ return newObj;
24556
+ },
24557
+ mod: function (obj, monocle, f) {
24558
+ var newObj = clone(obj);
24559
+ newObj[monocle] = f(obj[monocle]);
24560
+ return newObj;
24561
+ },
24562
+ del: function (obj, monocle) {
24563
+ var newObj = clone(obj);
24564
+ delete newObj[monocle];
24565
+ return newObj;
24566
+ }
24567
+ };
24568
+
24569
+ // STRING FUNCTIONS
24735
24570
 
24736
- var lens = /*@__PURE__*/getDefaultExportFromCjs(hubble.exports);
24571
+ const str = {
24572
+ get: function (arr, monocle) {
24573
+ return arr[monocle];
24574
+ },
24575
+ set: function (arr, monocle, val) {
24576
+ var newArr = arr.splice();
24577
+ newArr[monocle] = val;
24578
+ return newArr;
24579
+ },
24580
+ mod: function (arr, monocle, f) {
24581
+ var newArr = arr.splice();
24582
+ newArr[monocle] = f(arr[monocle]);
24583
+ return newArr;
24584
+ },
24585
+ del: function (arr, monocle) {
24586
+ var newArr = arr.slice();
24587
+ newArr.splice(monocle);
24588
+ return newArr;
24589
+ }
24590
+ };
24737
24591
 
24738
24592
  const _excluded$3 = ["children", "color", "onClick"];
24739
24593
  class SimpleButton extends React.Component {