@mideind/netskrafl-react 1.0.0-beta.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.
Files changed (68) hide show
  1. package/.eslintignore +8 -0
  2. package/.eslintrc.json +13 -0
  3. package/README.md +63 -0
  4. package/dist/cjs/index.css +6837 -0
  5. package/dist/cjs/index.js +3046 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/esm/index.css +6837 -0
  8. package/dist/esm/index.js +3046 -0
  9. package/dist/esm/index.js.map +1 -0
  10. package/dist/types.d.ts +41 -0
  11. package/package.json +63 -0
  12. package/rollup.config.js +60 -0
  13. package/src/components/index.ts +2 -0
  14. package/src/components/netskrafl/Netskrafl.stories.tsx +66 -0
  15. package/src/components/netskrafl/Netskrafl.tsx +135 -0
  16. package/src/components/netskrafl/Netskrafl.types.ts +7 -0
  17. package/src/components/netskrafl/index.ts +2 -0
  18. package/src/css/fonts.css +4 -0
  19. package/src/css/glyphs.css +224 -0
  20. package/src/css/skrafl-explo.css +6616 -0
  21. package/src/fonts/glyphicons-regular.eot +0 -0
  22. package/src/fonts/glyphicons-regular.ttf +0 -0
  23. package/src/fonts/glyphicons-regular.woff +0 -0
  24. package/src/index.ts +2 -0
  25. package/src/messages/messages.json +1576 -0
  26. package/src/mithril/actions.ts +319 -0
  27. package/src/mithril/bag.ts +65 -0
  28. package/src/mithril/bestdisplay.ts +74 -0
  29. package/src/mithril/blankdialog.ts +94 -0
  30. package/src/mithril/board.ts +336 -0
  31. package/src/mithril/buttons.ts +303 -0
  32. package/src/mithril/challengedialog.ts +186 -0
  33. package/src/mithril/channel.ts +162 -0
  34. package/src/mithril/chat.ts +228 -0
  35. package/src/mithril/components.ts +496 -0
  36. package/src/mithril/dragdrop.ts +219 -0
  37. package/src/mithril/elopage.ts +180 -0
  38. package/src/mithril/friend.ts +227 -0
  39. package/src/mithril/game.ts +1378 -0
  40. package/src/mithril/gameview.ts +111 -0
  41. package/src/mithril/globalstate.ts +33 -0
  42. package/src/mithril/i18n.ts +186 -0
  43. package/src/mithril/localstorage.ts +133 -0
  44. package/src/mithril/login.ts +122 -0
  45. package/src/mithril/logo.ts +270 -0
  46. package/src/mithril/main.ts +737 -0
  47. package/src/mithril/mithril.ts +29 -0
  48. package/src/mithril/model.ts +817 -0
  49. package/src/mithril/movelistitem.ts +226 -0
  50. package/src/mithril/page.ts +852 -0
  51. package/src/mithril/playername.ts +91 -0
  52. package/src/mithril/promodialog.ts +82 -0
  53. package/src/mithril/recentlist.ts +148 -0
  54. package/src/mithril/request.ts +52 -0
  55. package/src/mithril/review.ts +634 -0
  56. package/src/mithril/rightcolumn.ts +398 -0
  57. package/src/mithril/searchbutton.ts +118 -0
  58. package/src/mithril/statsdisplay.ts +109 -0
  59. package/src/mithril/tabs.ts +169 -0
  60. package/src/mithril/tile.ts +145 -0
  61. package/src/mithril/twoletter.ts +76 -0
  62. package/src/mithril/types.ts +379 -0
  63. package/src/mithril/userinfodialog.ts +171 -0
  64. package/src/mithril/util.ts +304 -0
  65. package/src/mithril/wait.ts +246 -0
  66. package/src/mithril/wordcheck.ts +102 -0
  67. package/tsconfig.json +28 -0
  68. package/vite.config.ts +12 -0
package/.eslintignore ADDED
@@ -0,0 +1,8 @@
1
+ node_modules
2
+ dist
3
+ .storybook
4
+ storybook-static
5
+ src/css
6
+ src/fonts
7
+ src/lib
8
+ src/stories
package/.eslintrc.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "parser": "@typescript-eslint/parser",
3
+ "extends": [
4
+ "eslint:recommended",
5
+ "plugin:@typescript-eslint/recommended",
6
+ "plugin:prettier/recommended"
7
+ ],
8
+ "plugins": ["@typescript-eslint", "prettier"],
9
+ "rules": {
10
+ "prettier/prettier": "error",
11
+ "@typescript-eslint/explicit-module-boundary-types": "off"
12
+ }
13
+ }
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+
2
+ # netskrafl-react
3
+
4
+ ## A React front end for Netskrafl
5
+
6
+ This is a web front end for the Netskrafl game server, packaged as a React component.
7
+
8
+ The component is written in TypeScript. It assumes that the containing application
9
+ (a) performs user authentication and (b) determines whether users have full access to the
10
+ Netskrafl functionality (typically by being paying subscribers) or limited/free access.
11
+ Information about (a) and (b) is passed to the component via its props.
12
+
13
+ The code for the Netskrafl backend server can be found on GitHub
14
+ at [https://github.com/mideind/Netskrafl](https://github.com/mideind/Netskrafl).
15
+ The backend is written in Python, using the Flask web framework.
16
+ The `netskrafl-react` component talks to the Netskrafl server via a
17
+ JSON API over HTTPS, and uses Firebase for real-time updates.
18
+
19
+ The source code for `netskrafl-react` is a bit unusual in that it was originally
20
+ written for the [Mithril](https://mithril.js.org) UI framework. The Mithril code
21
+ has been wrapped in a React component. Modifying the component thus requires
22
+ some familiarity with Mithril, as well as React. However, Mithril is fairly
23
+ straightforward and arguably simpler than React, so this should not be a major
24
+ obstacle.
25
+
26
+ ## Installation
27
+
28
+ To install the Netskrafl React component via `npm`, run the following command:
29
+
30
+ ```
31
+ npm install netskrafl-react
32
+ ```
33
+
34
+ ## Development
35
+
36
+ During development, you can run the rollup bundler in watch mode by running:
37
+
38
+ ```bash
39
+ npm run watch
40
+ ```
41
+
42
+ You can also use Storybook as a testing container by running:
43
+
44
+ ```bash
45
+ npm run storybook
46
+ ```
47
+
48
+ To build the component for production, run:
49
+
50
+ ```bash
51
+ npm run rollup
52
+ ```
53
+
54
+ See the `package.json` file for specifics.
55
+
56
+ ## License and copyright
57
+
58
+ Copyright © 2025 Miðeind ehf. The original author of `netskrafl-react`
59
+ is *Vilhjálmur Þorsteinsson*.
60
+
61
+ This code is released under the
62
+ [CC-BY-NC 4.0 license](https://creativecommons.org/licenses/by-nc/4.0/).
63
+ See the LICENSE file for details.