@@ -7,37 +7,20 @@ Object.defineProperty(exports, "__esModule", {
7
7
exports . reactServer = void 0 ;
8
8
var _regenerator = _interopRequireDefault ( require ( "@babel/runtime/regenerator" ) ) ;
9
9
var _asyncToGenerator2 = _interopRequireDefault ( require ( "@babel/runtime/helpers/asyncToGenerator" ) ) ;
10
- var _defineProperty2 = _interopRequireDefault ( require ( "@babel/runtime/helpers/defineProperty" ) ) ;
11
- var _toConsumableArray2 = _interopRequireDefault ( require ( "@babel/runtime/helpers/toConsumableArray" ) ) ;
12
10
var _taggedTemplateLiteral2 = _interopRequireDefault ( require ( "@babel/runtime/helpers/taggedTemplateLiteral" ) ) ;
13
11
var _apolloServerExpress = require ( "apollo-server-express" ) ;
14
12
var _graphqlTools = require ( "graphql-tools" ) ;
15
13
var _graphql = require ( "graphql" ) ;
16
14
var _http = require ( "http" ) ;
17
15
var _subscriptionsTransportWs = require ( "subscriptions-transport-ws" ) ;
18
16
var _reactServer = require ( "@state-less/react-server" ) ;
19
- var _leapBackend = require ( "@state-less/leap-backend" ) ;
20
17
var _instances = require ( "./instances" ) ;
21
18
var _resolvers = require ( "./resolvers" ) ;
22
19
var _schema = require ( "./schema" ) ;
23
- var _Navigation = require ( "./components/Navigation" ) ;
24
20
var _examples = require ( "./components/examples" ) ;
25
- var _Pages = require ( "./components/Pages" ) ;
26
- var _Votings = require ( "./components/Votings" ) ;
27
- var _Session = require ( "./components/Session" ) ;
28
- var _Poll = require ( "./components/Poll" ) ;
29
- var _Comments = require ( "./components/Comments" ) ;
30
21
var _logger = _interopRequireDefault ( require ( "./lib/logger" ) ) ;
31
- var _Features = require ( "./components/Features" ) ;
32
- var _ViewCounter = require ( "./components/ViewCounter" ) ;
33
- var _ChatRoom = require ( "./components/ChatRoom" ) ;
34
- var _Lists = require ( "./components/Lists" ) ;
35
- var _WebPushManager = require ( "./components/WebPushManager" ) ;
36
- var _permissions = require ( "./lib/permissions" ) ;
37
22
var _jsxRuntime = require ( "@state-less/react-server/dist/jsxRenderer/jsx-runtime" ) ;
38
- var _templateObject , _templateObject2 ; // import { Forum, ForumPolicies, Platform } from './components/Forum';
39
- function ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; enumerableOnly && ( symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ) , keys . push . apply ( keys , symbols ) ; } return keys ; }
40
- function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = null != arguments [ i ] ? arguments [ i ] : { } ; i % 2 ? ownKeys ( Object ( source ) , ! 0 ) . forEach ( function ( key ) { ( 0 , _defineProperty2 [ "default" ] ) ( target , key , source [ key ] ) ; } ) : Object . getOwnPropertyDescriptors ? Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) : ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } return target ; }
23
+ var _templateObject , _templateObject2 ;
41
24
_reactServer . Dispatcher . getCurrent ( ) . setStore ( _instances . store ) ;
42
25
_reactServer . Dispatcher . getCurrent ( ) . setPubSub ( _instances . pubsub ) ;
43
26
var PORT = 4000 ;
@@ -90,197 +73,8 @@ _subscriptionsTransportWs.SubscriptionServer.create({
90
73
server : httpServer ,
91
74
path : apolloServer . graphqlPath
92
75
} ) ;
93
- var landingList1 = {
94
- id : 'landing-list-1' ,
95
- title : 'Hello World' ,
96
- todos : [ {
97
- id : 'todo-0' ,
98
- title : 'Hello World' ,
99
- completed : true
100
- } , {
101
- id : 'todo-1' ,
102
- title : 'Add your first Todo Item' ,
103
- completed : false
104
- } , {
105
- id : 'todo-2' ,
106
- title : 'Add a counter item by clicking +' ,
107
- completed : false
108
- } ] ,
109
- order : [ 'todo-0' , 'todo-1' , 'todo-2' ]
110
- } ;
111
- var landingList2 = {
112
- id : 'landing-list-2' ,
113
- title : 'Colors' ,
114
- color : '#ABDDA477' ,
115
- todos : [ {
116
- id : 'counter-0' ,
117
- type : 'Counter' ,
118
- count : 3 ,
119
- title : 'Glasses of water'
120
- } ] ,
121
- order : [ 'counter-0' ]
122
- } ;
123
- var landingList3 = {
124
- id : 'landing-list-3' ,
125
- title : 'History' ,
126
- settings : {
127
- defaultType : 'Counter'
128
- } ,
129
- todos : [ {
130
- id : 'history-1' ,
131
- createdAt : + new Date ( '2024-01-01' ) ,
132
- count : 3 ,
133
- type : 'Counter' ,
134
- title : 'Joy' ,
135
- archived : + new Date ( '2024-01-01' )
136
- } , {
137
- id : 'history-2' ,
138
- createdAt : + new Date ( '2024-01-01' ) ,
139
- count : 2 ,
140
- type : 'Counter' ,
141
- title : 'Coffee' ,
142
- archived : + new Date ( '2024-01-01' )
143
- } , {
144
- id : 'history-3' ,
145
- createdAt : + new Date ( '2024-01-02' ) ,
146
- count : 1 ,
147
- type : 'Counter' ,
148
- title : 'Joy' ,
149
- archived : + new Date ( '2024-01-02' )
150
- } , {
151
- id : 'history-4' ,
152
- createdAt : + new Date ( '2024-01-02' ) ,
153
- count : 4 ,
154
- type : 'Counter' ,
155
- title : 'Coffee' ,
156
- archived : + new Date ( '2024-01-02' )
157
- } , {
158
- id : 'history-5' ,
159
- createdAt : + new Date ( '2024-01-03' ) ,
160
- count : 0 ,
161
- type : 'Counter' ,
162
- title : 'Joy' ,
163
- archived : + new Date ( '2024-01-03' )
164
- } , {
165
- id : 'history-6' ,
166
- createdAt : + new Date ( '2024-01-03' ) ,
167
- count : 0 ,
168
- type : 'Counter' ,
169
- title : 'Coffee' ,
170
- archived : + new Date ( '2024-01-03' )
171
- } , {
172
- id : 'history-7' ,
173
- createdAt : + new Date ( '2024-01-04' ) ,
174
- count : 2 ,
175
- type : 'Counter' ,
176
- title : 'Joy' ,
177
- archived : + new Date ( '2024-01-04' )
178
- } , {
179
- id : 'history-8' ,
180
- createdAt : + new Date ( '2024-01-04' ) ,
181
- count : 2 ,
182
- type : 'Counter' ,
183
- title : 'Coffee' ,
184
- archived : + new Date ( '2024-01-04' )
185
- } , {
186
- id : 'history-9' ,
187
- createdAt : + new Date ( '2024-01-05' ) ,
188
- count : 5 ,
189
- type : 'Counter' ,
190
- title : 'Joy' ,
191
- archived : + new Date ( '2024-01-05' )
192
- } , {
193
- id : 'history-10' ,
194
- createdAt : + new Date ( '2024-01-05' ) ,
195
- count : 2 ,
196
- type : 'Counter' ,
197
- title : 'Coffee' ,
198
- archived : + new Date ( '2024-01-05' )
199
- } , {
200
- id : 'history-11' ,
201
- createdAt : + new Date ( '2024-01-06' ) ,
202
- count : 3 ,
203
- type : 'Counter' ,
204
- title : 'Joy' ,
205
- archived : + new Date ( '2024-01-06' )
206
- } , {
207
- id : 'history-12' ,
208
- createdAt : + new Date ( '2024-01-06' ) ,
209
- count : 1 ,
210
- type : 'Counter' ,
211
- title : 'Coffee' ,
212
- archived : + new Date ( '2024-01-06' )
213
- } , {
214
- id : 'history-13' ,
215
- createdAt : + new Date ( '2024-01-07' ) ,
216
- count : 1 ,
217
- type : 'Counter' ,
218
- title : 'Joy' ,
219
- archived : + new Date ( '2024-01-07' )
220
- } , {
221
- id : 'history-14' ,
222
- createdAt : + new Date ( '2024-01-07' ) ,
223
- count : 1 ,
224
- type : 'Counter' ,
225
- title : 'Coffee' ,
226
- archived : + new Date ( '2024-01-07' )
227
- } , {
228
- id : 'history-15' ,
229
- createdAt : + new Date ( '2024-01-08' ) ,
230
- count : 1 ,
231
- type : 'Counter' ,
232
- title : 'Joy'
233
- } , {
234
- id : 'history-16' ,
235
- createdAt : + new Date ( '2024-01-08' ) ,
236
- count : 1 ,
237
- type : 'Counter' ,
238
- title : 'Coffee'
239
- } ] ,
240
- order : ( 0 , _toConsumableArray2 [ "default" ] ) ( Array ( 16 ) ) . map ( function ( _ , i ) {
241
- return "history-" . concat ( i + 1 ) ;
242
- } )
243
- } ;
244
- var demoList1 = {
245
- id : 'demo-list-1' ,
246
- title : 'Todos' ,
247
- order : [ 'todo-0' ] ,
248
- todos : [ {
249
- id : 'todo-0' ,
250
- title : 'Todo' ,
251
- type : 'Todo' ,
252
- completed : false
253
- } ]
254
- } ;
255
- var reactServer = ( 0 , _jsxRuntime . jsxs ) ( _reactServer . Server , {
256
- children : [ ( 0 , _jsxRuntime . jsx ) ( _ChatRoom . ChatApp , { } , "chat" ) , ( 0 , _jsxRuntime . jsx ) ( _ViewCounter . ViewCounter , { } , "view-counter" ) , ( 0 , _jsxRuntime . jsx ) ( _ViewCounter . ViewCounter , { } , "lists-views" ) , ( 0 , _jsxRuntime . jsx ) ( _ViewCounter . ViewCounter , { } , "js-forum-views" ) , ( 0 , _jsxRuntime . jsx ) ( _Features . Features , { } , "features" ) , ( 0 , _jsxRuntime . jsx ) ( _reactServer . TestComponent , { } , "test" ) , ( 0 , _jsxRuntime . jsx ) ( _Navigation . Navigation , { } , "navigation" ) , ( 0 , _jsxRuntime . jsx ) ( _examples . HelloWorldExample1 , { } , "hello-world-1" ) , ( 0 , _jsxRuntime . jsx ) ( _examples . HelloWorldExample2 , { } , "hello-world-2" ) , ( 0 , _jsxRuntime . jsx ) ( _Pages . Pages , { } , "pages" ) , ( 0 , _jsxRuntime . jsx ) ( _Pages . DynamicPage , { } , "page" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . MyLists , { } , "my-lists" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . MyListsMeta , { } , "my-lists-points" ) , ( 0 , _jsxRuntime . jsx ) ( _Votings . Votings , {
257
- policies : [ _Votings . VotingPolicies . SingleVote ]
258
- } , "votings" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . List , _objectSpread ( { } , landingList1 ) , "landing-list-1" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . List , _objectSpread ( { } , landingList2 ) , "landing-list-2" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . List , _objectSpread ( { } , landingList3 ) , "landing-list-3" ) , ( 0 , _jsxRuntime . jsx ) ( _Lists . List , _objectSpread ( { } , demoList1 ) , "todos" ) , ( 0 , _jsxRuntime . jsx ) ( _Votings . Votings , {
259
- policies : [ ]
260
- } , "votings-multiple" ) , ( 0 , _jsxRuntime . jsx ) ( _Session . Session , { } , "session" ) , ( 0 , _jsxRuntime . jsx ) ( _Poll . Poll , {
261
- values : [ 'Where can I get this?' , 'Meh...' , 'Shut up and take my money.' ] ,
262
- policies : [ _Poll . PollActions . Revert , _Poll . PollActions . Authenticate ]
263
- } , "poll" ) , ( 0 , _jsxRuntime . jsx ) ( _Poll . Poll , {
264
- values : [ 'Nice!' , 'Meh...' , "It's not working" , 'Add more features.' , 'Add a comment section.' , 'Shut up and take my money.' ] ,
265
- policies : [ _Poll . PollActions . Revert ]
266
- } , "poll-open" ) , ( 0 , _jsxRuntime . jsx ) ( _Comments . Comments , {
267
- policies : [ _Comments . CommentPolicies . Authenticate ]
268
- } , "comments" ) , ( 0 , _jsxRuntime . jsx ) ( _leapBackend . Platform , { } , "platform" ) , ( 0 , _jsxRuntime . jsx ) ( _leapBackend . Forum , {
269
- id : "community-forum" ,
270
- name : "Community" ,
271
- policies : [ _leapBackend . ForumPolicies . PostsNeedApproval ] ,
272
- users : _permissions . admins
273
- } , "community-forum" ) , ( 0 , _jsxRuntime . jsx ) ( _leapBackend . Forum , {
274
- id : "lists-forum" ,
275
- name : "Lists Forum" ,
276
- policies : [ _leapBackend . ForumPolicies . PostsNeedApproval ] ,
277
- users : _permissions . admins
278
- } , "lists-forum" ) , ( 0 , _jsxRuntime . jsx ) ( _leapBackend . Forum , {
279
- id : "javascript-forum" ,
280
- name : "JavaScript Forum" ,
281
- policies : [ _leapBackend . ForumPolicies . PostsNeedApproval ] ,
282
- users : _permissions . admins
283
- } , "javascript-forum" ) , ( 0 , _jsxRuntime . jsx ) ( _WebPushManager . WebPushManager , { } , "web-push" ) ]
76
+ var reactServer = ( 0 , _jsxRuntime . jsx ) ( _reactServer . Server , {
77
+ children : ( 0 , _jsxRuntime . jsx ) ( _examples . HelloWorldExample2 , { } , "button" )
284
78
} , "server" ) ;
285
79
exports . reactServer = reactServer ;
286
80
( 0 , _reactServer . render ) ( reactServer , {
0 commit comments